Skip to content

Commit

Permalink
Fixed #20013 -- A test for sqlall fails under Oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
shaib committed May 27, 2013
1 parent 5e05ec3 commit 1e29428
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/commands_sql/tests.py
Expand Up @@ -46,7 +46,13 @@ def test_sql_destroy_indexes(self):
def test_sql_all(self):
app = models.get_app('commands_sql')
output = sql_all(app, no_style(), connections[DEFAULT_DB_ALIAS])
# PostgreSQL creates two indexes
self.assertIn(len(output), [2, 3])
self.assertTrue(output[0].startswith('CREATE TABLE'))
self.assertTrue(output[1].startswith('CREATE INDEX'))
if connections[DEFAULT_DB_ALIAS].vendor == 'oracle':
self.assertEqual(len(output), 4) # Oracle creates a table, a sequence, a trigger and an index
self.assertIn('CREATE SEQUENCE', output[1])
self.assertIn('CREATE OR REPLACE TRIGGER', output[2])
self.assertTrue(output[3].startswith('CREATE INDEX'))
else:
# PostgreSQL creates two indexes
self.assertIn(len(output), [2, 3])
self.assertTrue(output[1].startswith('CREATE INDEX'))

0 comments on commit 1e29428

Please sign in to comment.