[Erp5-report] r40391 vincent - /erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Nov 18 18:16:09 CET 2010
Author: vincent
Date: Thu Nov 18 18:16:09 2010
New Revision: 40391
URL: http://svn.erp5.org?rev=40391&view=rev
Log:
Make it easier to debug this test.
Modified:
erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py
Modified: erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py?rev=40391&r1=40390&r2=40391&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py [utf8] (original)
+++ erp5/trunk/products/ZSQLCatalog/tests/testSQLCatalog.py [utf8] Thu Nov 18 18:16:09 2010
@@ -39,7 +39,8 @@ from DateTime import DateTime
from Products.ZSQLCatalog.SQLExpression import MergeConflictError
class MatchList(list):
- pass
+ def __repr__(self):
+ return '<%s %r>' % (self.__class__.__name__, self[:])
class ReferenceQuery:
"""
@@ -133,8 +134,13 @@ class ReferenceQuery:
raise TypeError, 'Compared value is not a (known) Query instance: (%s) %r' % (other.__class__.__name__, other)
def __repr__(self):
- return '<%s column=%r operator=%r value=%r args=%r>' % \
- (self.__class__.__name__, self.column, self.operator, self.value, self.args)
+ if self.args:
+ # ComplexQuery-ish
+ representation = (' %s ' % (self.operator, )).join(repr(x) for x in self.args)
+ else:
+ # SimpleQuery-ish
+ representation = '%r %r %r' % (self.column, self.operator, self.value)
+ return '<%s %s>' % (self.__class__.__name__, representation)
class RelatedReferenceQuery:
"""
More information about the Erp5-report
mailing list