Loading tests/schema/tests.py +5 −2 Original line number Diff line number Diff line Loading @@ -674,8 +674,11 @@ class SchemaTests(TransactionTestCase): with connection.schema_editor() as editor: editor.create_model(Author) editor.create_model(BookWithLongName) # Ensure the table is there and has the right index # Find the properly shortened column name column_name = connection.ops.quote_name("author_foreign_key_with_really_long_field_name_id") column_name = column_name[1:-1].lower() # unquote, and, for Oracle, un-upcase # Ensure the table is there and has an index on the column self.assertIn( "author_foreign_key_with_really_long_field_name_id", column_name, connection.introspection.get_indexes(connection.cursor(), BookWithLongName._meta.db_table), ) Loading
tests/schema/tests.py +5 −2 Original line number Diff line number Diff line Loading @@ -674,8 +674,11 @@ class SchemaTests(TransactionTestCase): with connection.schema_editor() as editor: editor.create_model(Author) editor.create_model(BookWithLongName) # Ensure the table is there and has the right index # Find the properly shortened column name column_name = connection.ops.quote_name("author_foreign_key_with_really_long_field_name_id") column_name = column_name[1:-1].lower() # unquote, and, for Oracle, un-upcase # Ensure the table is there and has an index on the column self.assertIn( "author_foreign_key_with_really_long_field_name_id", column_name, connection.introspection.get_indexes(connection.cursor(), BookWithLongName._meta.db_table), )