]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix unicode literals on Python 3.1 and 3.2
authorRoman Podolyaka <roman.podolyaka@gmail.com>
Sun, 23 Jun 2013 09:04:21 +0000 (12:04 +0300)
committerRoman Podolyaka <roman.podolyaka@gmail.com>
Sun, 23 Jun 2013 09:57:53 +0000 (12:57 +0300)
A few tests use u'' unicode literals which are not
supported in Python versions 3.1 and 3.2.

lib/sqlalchemy/testing/suite/test_select.py
test/dialect/test_postgresql.py

index b040c8f250bc854498696349d71914371891c30b..b8a755b8caaa9b70024ac7a4289ef171b7a2d953 100644 (file)
@@ -1,6 +1,7 @@
 from .. import fixtures, config
 from ..assertions import eq_
 
+from sqlalchemy import util
 from sqlalchemy import Integer, String, select, func
 
 from ..schema import Table, Column
@@ -63,7 +64,7 @@ class OrderByLabelTest(fixtures.TablesTest):
         ly = (func.lower(table.c.q) + table.c.p).label('ly')
         self._assert_result(
             select([lx, ly]).order_by(lx, ly.desc()),
-            [(3, u'q1p3'), (5, u'q2p2'), (7, u'q3p1')]
+            [(3, util.u('q1p3')), (5, util.u('q2p2')), (7, util.u('q3p1'))]
         )
 
     def test_plain_desc(self):
index 5b610bb4080b8e69c5fd1e733963b7ee12f1c52e..46a7b316ba92847e01306b9ca8cb1af39d03d388 100644 (file)
@@ -3265,17 +3265,17 @@ class HStoreRoundTripTest(fixtures.TablesTest):
 
     def _test_unicode_round_trip(self, engine):
         s = select([
-                hstore(
-                    array([u'réveillé', u'drôle', u'S’il']),
-                    array([u'réveillé', u'drôle', u'S’il'])
-                )
-            ])
+            hstore(
+                array([util.u('réveillé'), util.u('drôle'), util.u('S’il')]),
+                array([util.u('réveillé'), util.u('drôle'), util.u('S’il')])
+            )
+        ])
         eq_(
             engine.scalar(s),
             {
-                u'réveillé': u'réveillé',
-                u'drôle': u'drôle',
-                u'S’il': u'S’il'
+                util.u('réveillé'): util.u('réveillé'),
+                util.u('drôle'): util.u('drôle'),
+                util.u('S’il'): util.u('S’il')
             }
         )