mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-25 10:23:43 +03:00
Fixed sql.Composed representation
This commit is contained in:
parent
600416aafc
commit
8c020ca47a
|
@ -54,7 +54,7 @@ class Composed(Composible):
|
|||
self._seq.append(i)
|
||||
|
||||
def __repr__(self):
|
||||
return "sql.Composed(%r)" % (self.seq,)
|
||||
return "sql.Composed(%r)" % (self._seq,)
|
||||
|
||||
def as_string(self, conn_or_curs):
|
||||
rv = []
|
||||
|
|
|
@ -189,6 +189,12 @@ class ComposedTest(ConnectingTestCase):
|
|||
def test_class(self):
|
||||
self.assert_(issubclass(sql.Composed, sql.Composible))
|
||||
|
||||
def test_repr(self):
|
||||
obj = sql.Composed([sql.Literal("foo"), sql.Identifier("b'ar")])
|
||||
self.assertEqual(repr(obj),
|
||||
"""sql.Composed([sql.Literal('foo'), sql.Identifier("b'ar")])""")
|
||||
self.assertEqual(str(obj), repr(obj))
|
||||
|
||||
def test_join(self):
|
||||
obj = sql.Composed([sql.Literal("foo"), sql.Identifier("b'ar")])
|
||||
obj = obj.join(", ")
|
||||
|
|
Loading…
Reference in New Issue
Block a user