Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #20013 -- A test for sqlall fails under Oracle

  • Loading branch information...
commit 1e29428db292a8d2c5a4c6492ab1407834081235 1 parent 5e05ec3
shaib authored May 27, 2013

Showing 1 changed file with 9 additions and 3 deletions. Show diff stats Hide diff stats

  1. 12  tests/commands_sql/tests.py
12  tests/commands_sql/tests.py
@@ -46,7 +46,13 @@ def test_sql_destroy_indexes(self):
46 46
     def test_sql_all(self):
47 47
         app = models.get_app('commands_sql')
48 48
         output = sql_all(app, no_style(), connections[DEFAULT_DB_ALIAS])
49  
-        # PostgreSQL creates two indexes
50  
-        self.assertIn(len(output), [2, 3])
51 49
         self.assertTrue(output[0].startswith('CREATE TABLE'))
52  
-        self.assertTrue(output[1].startswith('CREATE INDEX'))
  50
+        if connections[DEFAULT_DB_ALIAS].vendor == 'oracle':
  51
+            self.assertEqual(len(output), 4) # Oracle creates a table, a sequence, a trigger and an index
  52
+            self.assertIn('CREATE SEQUENCE', output[1])
  53
+            self.assertIn('CREATE OR REPLACE TRIGGER', output[2])
  54
+            self.assertTrue(output[3].startswith('CREATE INDEX'))
  55
+        else:
  56
+            # PostgreSQL creates two indexes
  57
+            self.assertIn(len(output), [2, 3])
  58
+            self.assertTrue(output[1].startswith('CREATE INDEX'))

0 notes on commit 1e29428

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