Skip to content

Commit

Permalink
Fixed encoding tests on Py3
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarrazzo committed Jul 1, 2016
1 parent 9c156d4 commit 70af49c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_quote.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def test_encoding_default(self):
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
Expand All @@ -212,7 +212,7 @@ def test_set_encoding(self):
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
Expand All @@ -224,7 +224,7 @@ def test_connection_wins_anyway(self):
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():
Expand Down

0 comments on commit 70af49c

Please sign in to comment.