Don't register the unicode typecaster globally during tests

It can invalidate the results in further runs in the same process.
This commit is contained in:
Daniele Varrazzo 2011-01-03 17:29:04 +01:00
parent 131c6a25e9
commit 8b0af283f6

View File

@ -71,7 +71,7 @@ class QuotingTestCase(unittest.TestCase):
if not 0xD800 <= u <= 0xDFFF ])) # surrogate area
self.conn.set_client_encoding('UNICODE')
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE, self.conn)
curs.execute("SELECT %s::text;", (data,))
res = curs.fetchone()[0]