diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-07-22 12:49:56 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-07-22 12:51:03 +0200 |
| commit | 2ff2084cfdac5c49261a091f5094feed96d0de4c (patch) | |
| tree | 46f4c16e910cc1ed8828966bded14ef97d5200d9 | |
| parent | 7a3fa3af68809e71d18fedc673ab64152e8940b9 (diff) | |
[3.1.x] Fixed #31805 -- Fixed SchemaTests.tearDown() when table names are case-insensitive.
Backport of fd53db842c35c994dbd54196dd38a908f3676b1a from master
| -rw-r--r-- | tests/schema/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py index 0e060a5a0e..c9e61fb1bc 100644 --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -88,8 +88,12 @@ class SchemaTests(TransactionTestCase): with connection.schema_editor() as editor: connection.disable_constraint_checking() table_names = connection.introspection.table_names() + if connection.features.ignores_table_name_case: + table_names = [table_name.lower() for table_name in table_names] for model in itertools.chain(SchemaTests.models, self.local_models): tbl = converter(model._meta.db_table) + if connection.features.ignores_table_name_case: + tbl = tbl.lower() if tbl in table_names: editor.delete_model(model) table_names.remove(tbl) |
