diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2014-06-08 18:57:55 -0700 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2014-06-08 18:57:55 -0700 |
| commit | 8721adcbfbc0bba7fe8341605a4ab4dffd9774d6 (patch) | |
| tree | 7ed89e464bc33bcd8236b1ca083179485baf4bc3 | |
| parent | 3f91238adf819b1d86f800d6b535b3c04447dac2 (diff) | |
Fix router_honored test to not close connection
| -rw-r--r-- | tests/commands_sql/tests.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/commands_sql/tests.py b/tests/commands_sql/tests.py index 7ef28f83db..8360648e51 100644 --- a/tests/commands_sql/tests.py +++ b/tests/commands_sql/tests.py @@ -27,7 +27,7 @@ class SQLCommandsTestCase(TestCase): def test_sql_delete(self): app_config = apps.get_app_config('commands_sql') - output = sql_delete(app_config, no_style(), connections[DEFAULT_DB_ALIAS]) + output = sql_delete(app_config, no_style(), connections[DEFAULT_DB_ALIAS], close_connection=False) drop_tables = [o for o in output if o.startswith('DROP TABLE')] self.assertEqual(len(drop_tables), 3) # Lower so that Oracle's upper case tbl names wont break @@ -71,6 +71,9 @@ class SQLCommandsRouterTestCase(TestCase): def test_router_honored(self): app_config = apps.get_app_config('commands_sql') for sql_command in (sql_all, sql_create, sql_delete, sql_indexes, sql_destroy_indexes): - output = sql_command(app_config, no_style(), connections[DEFAULT_DB_ALIAS]) + if sql_command is sql_delete: + output = sql_command(app_config, no_style(), connections[DEFAULT_DB_ALIAS], close_connection=False) + else: + output = sql_command(app_config, no_style(), connections[DEFAULT_DB_ALIAS]) self.assertEqual(len(output), 0, "%s command is not honoring routers" % sql_command.__name__) |
