diff options
author | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2015-10-13 17:29:55 +0200 |
---|---|---|
committer | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2015-10-14 17:00:25 +0200 |
commit | 9295bce154182863e19342b6a4c2e80a58187120 (patch) | |
tree | 435b1d62fed20ad16c571673e682de2c364f2392 /tests/test_quote.py | |
parent | c73c1c577170f51c2dfadcdb61c34e4def82d709 (diff) | |
download | psycopg2-9295bce154182863e19342b6a4c2e80a58187120.tar.gz |
Add psycopg2.extensions.quote_ident.
Diffstat (limited to 'tests/test_quote.py')
-rwxr-xr-x | tests/test_quote.py | 7 |
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__) |