@@ -210,32 +210,27 @@ def test_error_capture(self):
210
210
# Added to validate unicode support and register_type.
211
211
def test_unicode (self ):
212
212
ext .register_type (ext .UNICODE , self .cursor )
213
- #
214
- # Python 2 chokes on Unicode and CircleCI tests are hanging (but pass locally).
215
- # Disable these tests for now as we want to really just test register_type
216
- # anyways
217
- #
218
- # snowman = "\u2603"
219
- #
220
- # self.cursor.execute("delete from users where id in (1,2,3)")
221
- #
222
- # # unicode in statement
223
- # psycopg2.extras.execute_batch(self.cursor,
224
- # "insert into users (id, name) values (%%s, %%s) -- %s" % snowman, [(1, 'x')])
225
- # self.cursor.execute("select id, name from users where id = 1")
226
- # self.assertEqual(self.cursor.fetchone(), (1, 'x'))
227
- #
228
- # # unicode in data
229
- # psycopg2.extras.execute_batch(self.cursor,
230
- # "insert into users (id, name) values (%s, %s)", [(2, snowman)])
231
- # self.cursor.execute("select id, name from users where id = 2")
232
- # self.assertEqual(self.cursor.fetchone(), (2, snowman))
233
- #
234
- # # unicode in both
235
- # psycopg2.extras.execute_batch(self.cursor,
236
- # "insert into users (id, name) values (%%s, %%s) -- %s" % snowman, [(3, snowman)])
237
- # self.cursor.execute("select id, name from users where id = 3")
238
- # self.assertEqual(self.cursor.fetchone(), (3, snowman))
213
+ snowman = "\u2603 "
214
+
215
+ self .cursor .execute ("delete from users where id in (1,2,3)" )
216
+
217
+ # unicode in statement
218
+ psycopg2 .extras .execute_batch (self .cursor ,
219
+ "insert into users (id, name) values (%%s, %%s) -- %s" % snowman , [(1 , 'x' )])
220
+ self .cursor .execute ("select id, name from users where id = 1" )
221
+ self .assertEqual (self .cursor .fetchone (), (1 , 'x' ))
222
+
223
+ # unicode in data
224
+ psycopg2 .extras .execute_batch (self .cursor ,
225
+ "insert into users (id, name) values (%s, %s)" , [(2 , snowman )])
226
+ self .cursor .execute ("select id, name from users where id = 2" )
227
+ self .assertEqual (self .cursor .fetchone (), (2 , snowman ))
228
+
229
+ # unicode in both
230
+ psycopg2 .extras .execute_batch (self .cursor ,
231
+ "insert into users (id, name) values (%%s, %%s) -- %s" % snowman , [(3 , snowman )])
232
+ self .cursor .execute ("select id, name from users where id = 3" )
233
+ self .assertEqual (self .cursor .fetchone (), (3 , snowman ))
239
234
240
235
def test_register_type (self ):
241
236
import uuid
0 commit comments