mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #20007 -- Configured psycopg2 to return UnicodeArrays
Thanks hogbait for the report.
This commit is contained in:
parent
926bc421d9
commit
ded40142a9
3 changed files with 22 additions and 0 deletions
|
@ -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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue