summaryrefslogtreecommitdiff
path: root/test/dialect/test_postgresql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-05-29 18:08:28 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-05-29 18:08:28 -0400
commit534e05888e1ec7018c03d979df4f34074a61f12b (patch)
tree45ca244b99ea893fbff553b47caa46915574e914 /test/dialect/test_postgresql.py
parent9fc6201f0c039631de436d38d7b162f56f9b08dd (diff)
downloadsqlalchemy-534e05888e1ec7018c03d979df4f34074a61f12b.tar.gz
hstores are text, and in py3k they seem to be implcitly unicode. so
add unicode encoding for py2k for the non-native hstore, pullreq for native psycopg2 support coming....
Diffstat (limited to 'test/dialect/test_postgresql.py')
-rw-r--r--test/dialect/test_postgresql.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py
index 286628d5e..3931a1968 100644
--- a/test/dialect/test_postgresql.py
+++ b/test/dialect/test_postgresql.py
@@ -3207,3 +3207,28 @@ class HStoreRoundTripTest(fixtures.TablesTest):
def test_fixed_round_trip_native(self):
engine = testing.db
self._test_fixed_round_trip(engine)
+
+ 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'])
+ )
+ ])
+ eq_(
+ engine.scalar(s),
+ {
+ u'réveillé': u'réveillé',
+ u'drôle': u'drôle',
+ u'S’il': u'S’il'
+ }
+ )
+
+ def test_unicode_round_trip_python(self):
+ engine = self._non_native_engine()
+ self._test_unicode_round_trip(engine)
+
+ @testing.only_on("postgresql+psycopg2")
+ def test_unicode_round_trip_native(self):
+ engine = testing.db
+ self._test_unicode_round_trip(engine)