summaryrefslogtreecommitdiff
path: root/tests/test_quote.py
diff options
context:
space:
mode:
authorOleksandr Shulgin <oleksandr.shulgin@zalando.de>2015-10-13 17:29:55 +0200
committerOleksandr Shulgin <oleksandr.shulgin@zalando.de>2015-10-14 17:00:25 +0200
commit9295bce154182863e19342b6a4c2e80a58187120 (patch)
tree435b1d62fed20ad16c571673e682de2c364f2392 /tests/test_quote.py
parentc73c1c577170f51c2dfadcdb61c34e4def82d709 (diff)
downloadpsycopg2-9295bce154182863e19342b6a4c2e80a58187120.tar.gz
Add psycopg2.extensions.quote_ident.
Diffstat (limited to 'tests/test_quote.py')
-rwxr-xr-xtests/test_quote.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_quote.py b/tests/test_quote.py
index e7b3c31..a24ab6d 100755
--- a/tests/test_quote.py
+++ b/tests/test_quote.py
@@ -165,6 +165,13 @@ class TestQuotedString(ConnectingTestCase):
self.assertEqual(q.encoding, 'utf_8')
+class TestQuotedIdentifier(ConnectingTestCase):
+ def test_identifier(self):
+ from psycopg2.extensions import quote_ident
+ self.assertEqual(quote_ident('blah-blah', self.conn), '"blah-blah"')
+ self.assertEqual(quote_ident('quote"inside', self.conn), '"quote""inside"')
+
+
def test_suite():
return unittest.TestLoader().loadTestsFromName(__name__)