diff options
| author | Josh Smeaton <josh.smeaton@gmail.com> | 2012-06-12 20:30:52 +1000 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2012-06-26 19:39:14 +0300 |
| commit | fa182e8ae82f33764d5e1f70bcd45899e1bf17e6 (patch) | |
| tree | 7fc3cafe26dd5396dce8fe5ec341115ed9b27c25 /tests/regressiontests | |
| parent | 05d333ba3bb16af024c11966d2072de38fe9f82f (diff) | |
Fixed #18465 -- Set date formats correctly on Oracle
Correctly configure NLS_SESSION_PARAMETERS to format Date and DateTime
on Oracle backend.
Thanks to Josh Smeaton for report & patch.
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/backends/tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py index c6d28ab135..cb25ac0a32 100644 --- a/tests/regressiontests/backends/tests.py +++ b/tests/regressiontests/backends/tests.py @@ -66,6 +66,18 @@ class OracleChecks(unittest.TestCase): self.assertEqual(connection.connection.encoding, "UTF-8") self.assertEqual(connection.connection.nencoding, "UTF-8") + @unittest.skipUnless(connection.vendor == 'oracle', + "No need to check Oracle connection semantics") + def test_order_of_nls_parameters(self): + # an 'almost right' datetime should work with configured + # NLS parameters as per #18465. + c = connection.cursor() + query = "select 1 from dual where '1936-12-29 00:00' < sysdate" + # Test that the query succeeds without errors - pre #18465 this + # wasn't the case. + c.execute(query) + self.assertEqual(c.fetchone()[0], 1) + class MySQLTests(TestCase): @unittest.skipUnless(connection.vendor == 'mysql', "Test valid only for MySQL") |
