From 99b5526c19841abb398364947d04460f743dc216 Mon Sep 17 00:00:00 2001 From: Ian Kelly Date: Fri, 3 Dec 2010 18:39:09 +0000 Subject: [PATCH] [1.2.X] Added a regression test for r14781. Backport of r14783 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14784 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/backends/tests.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py index 005fc4d86e..10cec8962d 100644 --- a/tests/regressiontests/backends/tests.py +++ b/tests/regressiontests/backends/tests.py @@ -11,7 +11,7 @@ from django.test import TestCase, TransactionTestCase import models -class Callproc(unittest.TestCase): +class OracleChecks(unittest.TestCase): def test_dbms_session(self): # If the backend is Oracle, test that we can call a standard @@ -34,9 +34,6 @@ class Callproc(unittest.TestCase): cursor.execute("BEGIN %s := 'X'; END; ", [var]) self.assertEqual(var.getvalue(), 'X') - -class LongString(unittest.TestCase): - def test_long_string(self): # If the backend is Oracle, test that we can save a text longer # than 4000 chars and read it properly @@ -50,6 +47,14 @@ class LongString(unittest.TestCase): self.assertEquals(long_str, row[0].read()) c.execute('DROP TABLE ltext') + def test_client_encoding(self): + # If the backend is Oracle, test that the client encoding is set + # correctly. This was broken under Cygwin prior to r14781. + if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'] == 'django.db.backends.oracle': + c = connection.cursor() # Ensure the connection is initialized. + self.assertEqual(connection.connection.encoding, "UTF-8") + self.assertEqual(connection.connection.nencoding, "UTF-8") + class DateQuotingTest(TestCase): def test_django_date_trunc(self):