mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 21:00:33 +03:00
Fixed tests failures on Python != 2.7
This commit is contained in:
parent
ce0d63babb
commit
ecb1ef2353
|
@ -66,10 +66,13 @@ class QuotingTestCase(ConnectingTestCase):
|
||||||
curs = self.conn.cursor()
|
curs = self.conn.cursor()
|
||||||
data = 'abcd\x01\x00cdefg'
|
data = 'abcd\x01\x00cdefg'
|
||||||
|
|
||||||
with self.assertRaises(ValueError) as e:
|
try:
|
||||||
curs.execute("SELECT %s", (data,))
|
curs.execute("SELECT %s", (data,))
|
||||||
|
except ValueError as e:
|
||||||
self.assertEquals(e.exception.message, 'A string literal cannot contain NUL (0x00) characters.')
|
self.assertEquals(str(e),
|
||||||
|
'A string literal cannot contain NUL (0x00) characters.')
|
||||||
|
else:
|
||||||
|
self.fail("ValueError not raised")
|
||||||
|
|
||||||
def test_binary(self):
|
def test_binary(self):
|
||||||
data = b("""some data with \000\013 binary
|
data = b("""some data with \000\013 binary
|
||||||
|
|
Loading…
Reference in New Issue
Block a user