summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-06-02 19:17:17 -0400
committerTim Graham <timograham@gmail.com>2015-06-02 19:45:24 -0400
commit2009525c8b7cc9246acc094e9e271f887b09cce9 (patch)
tree849ba9966f65cfec9f2be886a8dc7668e044bbcb
parentefdcd13c340cee944531747c24be890af1e46710 (diff)
[1.8.x] Applied db_table conversion to fix schema tests on Oracle.
Backport of 7c637a3aaec311269bf863c220bf894eebbe7c7c from master
-rw-r--r--tests/schema/tests.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index 23a79dd4bd..e388d318a3 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -61,6 +61,7 @@ class SchemaTests(TransactionTestCase):
def delete_tables(self):
"Deletes all model tables for our models for a clean test environment"
+ converter = connection.introspection.table_name_converter
with connection.cursor() as cursor:
connection.disable_constraint_checking()
table_names = connection.introspection.table_names(cursor)
@@ -68,7 +69,7 @@ class SchemaTests(TransactionTestCase):
# Remove any M2M tables first
for field in model._meta.local_many_to_many:
with atomic():
- tbl = field.rel.through._meta.db_table
+ tbl = converter(field.rel.through._meta.db_table)
if tbl in table_names:
cursor.execute(connection.schema_editor().sql_delete_table % {
"table": connection.ops.quote_name(tbl),
@@ -76,7 +77,7 @@ class SchemaTests(TransactionTestCase):
table_names.remove(tbl)
# Then remove the main tables
with atomic():
- tbl = model._meta.db_table
+ tbl = converter(model._meta.db_table)
if tbl in table_names:
cursor.execute(connection.schema_editor().sql_delete_table % {
"table": connection.ops.quote_name(tbl),