Loading AUTHORS +1 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ answer newbie questions, and generally made Django that much better: Craig Blaszczyk <masterjakul@gmail.com> David Blewett <david@dawninglight.net> Artem Gnilov <boobsd@gmail.com> Eric Boersma <eric.boersma@gmail.com> Matías Bordese Nate Bragg <jonathan.bragg@alum.rpi.edu> Sean Brant Loading django/db/backends/postgresql_psycopg2/base.py +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ DatabaseError = Database.DatabaseError IntegrityError = Database.IntegrityError psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY) psycopg2.extensions.register_adapter(SafeBytes, psycopg2.extensions.QuotedString) psycopg2.extensions.register_adapter(SafeText, psycopg2.extensions.QuotedString) Loading tests/backends/tests.py +20 −0 Original line number Diff line number Diff line Loading @@ -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
AUTHORS +1 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ answer newbie questions, and generally made Django that much better: Craig Blaszczyk <masterjakul@gmail.com> David Blewett <david@dawninglight.net> Artem Gnilov <boobsd@gmail.com> Eric Boersma <eric.boersma@gmail.com> Matías Bordese Nate Bragg <jonathan.bragg@alum.rpi.edu> Sean Brant Loading
django/db/backends/postgresql_psycopg2/base.py +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ DatabaseError = Database.DatabaseError IntegrityError = Database.IntegrityError psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY) psycopg2.extensions.register_adapter(SafeBytes, psycopg2.extensions.QuotedString) psycopg2.extensions.register_adapter(SafeText, psycopg2.extensions.QuotedString) Loading
tests/backends/tests.py +20 −0 Original line number Diff line number Diff line Loading @@ -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])