mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 00:46:33 +03:00
parent
b46424447f
commit
dd2ff2af56
6
NEWS
6
NEWS
|
@ -1,6 +1,12 @@
|
|||
Current release
|
||||
---------------
|
||||
|
||||
What's new in psycopg 2.9.1
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Fix regression with named `sql.Placeholder` (:ticket:`1291`).
|
||||
|
||||
|
||||
What's new in psycopg 2.9
|
||||
-------------------------
|
||||
|
||||
|
|
|
@ -442,7 +442,7 @@ class Placeholder(Composable):
|
|||
|
||||
def as_string(self, context):
|
||||
if self._wrapped is not None:
|
||||
return f"%({self._wrapped})"
|
||||
return f"%({self._wrapped})s"
|
||||
else:
|
||||
return "%s"
|
||||
|
||||
|
|
|
@ -393,6 +393,10 @@ class PlaceholderTest(ConnectingTestCase):
|
|||
self.assert_(sql.Placeholder('foo') != sql.Placeholder())
|
||||
self.assert_(sql.Placeholder('foo') != sql.Literal('foo'))
|
||||
|
||||
def test_as_string(self):
|
||||
self.assertEqual(sql.Placeholder().as_string(self.conn), "%s")
|
||||
self.assertEqual(sql.Placeholder('foo').as_string(self.conn), "%(foo)s")
|
||||
|
||||
|
||||
class ValuesTest(ConnectingTestCase):
|
||||
def test_null(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user