mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-14 04:56:33 +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)
|
self._seq.append(i)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "sql.Composed(%r)" % (self.seq,)
|
return "sql.Composed(%r)" % (self._seq,)
|
||||||
|
|
||||||
def as_string(self, conn_or_curs):
|
def as_string(self, conn_or_curs):
|
||||||
rv = []
|
rv = []
|
||||||
|
|
|
@ -189,6 +189,12 @@ class ComposedTest(ConnectingTestCase):
|
||||||
def test_class(self):
|
def test_class(self):
|
||||||
self.assert_(issubclass(sql.Composed, sql.Composible))
|
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):
|
def test_join(self):
|
||||||
obj = sql.Composed([sql.Literal("foo"), sql.Identifier("b'ar")])
|
obj = sql.Composed([sql.Literal("foo"), sql.Identifier("b'ar")])
|
||||||
obj = obj.join(", ")
|
obj = obj.join(", ")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user