Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed Oracle specific failures in commands_sql tests

  • Loading branch information...
commit dcf651c27edff13236fda0a480059b57dbe6e074 1 parent e5a8df0
Anssi Kääriäinen authored
11  tests/regressiontests/commands_sql/tests.py
@@ -15,12 +15,19 @@ class SQLCommandsTestCase(TestCase):
15 15
     def test_sql_create(self):
16 16
         app = models.get_app('commands_sql')
17 17
         output = sql_create(app, no_style(), connections[DEFAULT_DB_ALIAS])
18  
-        six.assertRegex(self, output[0], r'^CREATE TABLE .commands_sql_book.*')
  18
+        # Lower so that Oracle's upper case tbl names wont break
  19
+        sql = output[0].lower()
  20
+        six.assertRegex(self, sql, r'^create table .commands_sql_book.*')
19 21
 
20 22
     def test_sql_delete(self):
21 23
         app = models.get_app('commands_sql')
22 24
         output = sql_delete(app, no_style(), connections[DEFAULT_DB_ALIAS])
23  
-        six.assertRegex(self, output[0], r'^DROP TABLE .commands_sql_book.*')
  25
+        # Oracle produces DROP SEQUENCE and DROP TABLE for this command.
  26
+        if connections[DEFAULT_DB_ALIAS].vendor == 'oracle':
  27
+            sql = output[1].lower()
  28
+        else:
  29
+            sql = output[0].lower()
  30
+        six.assertRegex(self, sql, r'^drop table .commands_sql_book.*')
24 31
 
25 32
     def test_sql_indexes(self):
26 33
         app = models.get_app('commands_sql')

0 notes on commit dcf651c

Please sign in to comment.
Something went wrong with that request. Please try again.