summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEric Boersma <eric.boersma@gmail.com>2013-09-06 20:43:41 -0400
committerTim Graham <timograham@gmail.com>2013-09-06 20:43:58 -0400
commitded40142a92813a8901faa4a6ca398e6679152f6 (patch)
tree2c894fda26439a709b0436692d47710a17398703 /tests
parent926bc421d9bcf04a79f0026a60d3d4b0570b7fe2 (diff)
Fixed #20007 -- Configured psycopg2 to return UnicodeArrays
Thanks hogbait for the report.
Diffstat (limited to 'tests')
-rw-r--r--tests/backends/tests.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/backends/tests.py b/tests/backends/tests.py
index 25df8ea139..94a92c75b9 100644
--- a/tests/backends/tests.py
+++ b/tests/backends/tests.py
@@ -963,3 +963,23 @@ class BackendUtilTests(TestCase):
'0.1')
equal('0.1234567890', 12, 0,
'0')
+
+@unittest.skipUnless(
+ connection.vendor == 'postgresql',
+ "This test applies only to PostgreSQL")
+class UnicodeArrayTestCase(TestCase):
+
+ def select(self, val):
+ cursor = connection.cursor()
+ cursor.execute("select %s", (val,))
+ return cursor.fetchone()[0]
+
+ def test_select_ascii_array(self):
+ a = ["awef"]
+ b = self.select(a)
+ self.assertEqual(a[0], b[0])
+
+ def test_select_unicode_array(self):
+ a = [u"ᄲawef"]
+ b = self.select(a)
+ self.assertEqual(a[0], b[0])