summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-07-01 18:50:24 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-07-01 18:50:24 +0100
commit70af49c0a2a59c516fe89b30019430b8db551833 (patch)
tree0759cfaa8b83139ae9ca2e0ff2f8ddea5f5da9d5 /tests
parent9c156d41bbd9afe202c74cddb5c95d5ebd8aeb67 (diff)
downloadpsycopg2-70af49c0a2a59c516fe89b30019430b8db551833.tar.gz
Fixed encoding tests on Py3
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_quote.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_quote.py b/tests/test_quote.py
index 0a204c8..74b366c 100755
--- a/tests/test_quote.py
+++ b/tests/test_quote.py
@@ -189,7 +189,7 @@ class TestStringAdapter(ConnectingTestCase):
from psycopg2.extensions import adapt
a = adapt("hello")
self.assertEqual(a.encoding, 'latin1')
- self.assertEqual(a.getquoted(), "'hello'")
+ self.assertEqual(a.getquoted(), b("'hello'"))
# NOTE: we can't really test an encoding different from utf8, because
# when encoding without connection the libpq will use parameters from
@@ -212,7 +212,7 @@ class TestStringAdapter(ConnectingTestCase):
a = adapt(snowman)
a.encoding = 'utf8'
self.assertEqual(a.encoding, 'utf8')
- self.assertEqual(a.getquoted(), "'\xe2\x98\x83'")
+ self.assertEqual(a.getquoted(), b("'\xe2\x98\x83'"))
def test_connection_wins_anyway(self):
from psycopg2.extensions import adapt
@@ -224,7 +224,7 @@ class TestStringAdapter(ConnectingTestCase):
a.prepare(self.conn)
self.assertEqual(a.encoding, 'utf_8')
- self.assertEqual(a.getquoted(), "'\xe2\x98\x83'")
+ self.assertEqual(a.getquoted(), b("'\xe2\x98\x83'"))
def test_suite():