summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJosh Smeaton <josh.smeaton@gmail.com>2012-06-12 20:30:52 +1000
committerAnssi Kääriäinen <akaariai@gmail.com>2012-06-26 19:39:14 +0300
commitfa182e8ae82f33764d5e1f70bcd45899e1bf17e6 (patch)
tree7fc3cafe26dd5396dce8fe5ec341115ed9b27c25 /tests
parent05d333ba3bb16af024c11966d2072de38fe9f82f (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')
-rw-r--r--tests/regressiontests/backends/tests.py12
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")