mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-25 18:33:44 +03:00
parent
b46424447f
commit
dd2ff2af56
6
NEWS
6
NEWS
|
@ -1,6 +1,12 @@
|
||||||
Current release
|
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
|
What's new in psycopg 2.9
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
|
|
|
@ -442,7 +442,7 @@ class Placeholder(Composable):
|
||||||
|
|
||||||
def as_string(self, context):
|
def as_string(self, context):
|
||||||
if self._wrapped is not None:
|
if self._wrapped is not None:
|
||||||
return f"%({self._wrapped})"
|
return f"%({self._wrapped})s"
|
||||||
else:
|
else:
|
||||||
return "%s"
|
return "%s"
|
||||||
|
|
||||||
|
|
|
@ -393,6 +393,10 @@ class PlaceholderTest(ConnectingTestCase):
|
||||||
self.assert_(sql.Placeholder('foo') != sql.Placeholder())
|
self.assert_(sql.Placeholder('foo') != sql.Placeholder())
|
||||||
self.assert_(sql.Placeholder('foo') != sql.Literal('foo'))
|
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):
|
class ValuesTest(ConnectingTestCase):
|
||||||
def test_null(self):
|
def test_null(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user