mirror of https://github.com/django/django.git
Fixed #21151 -- Bad cleanup in schema M2M repoint test
This commit is contained in:
parent
16ceb05b47
commit
6ede1db331
|
@ -307,6 +307,9 @@ class SchemaTests(TransactionTestCase):
|
||||||
else:
|
else:
|
||||||
self.fail("No FK constraint for uniquetest_id found")
|
self.fail("No FK constraint for uniquetest_id found")
|
||||||
finally:
|
finally:
|
||||||
|
# Cleanup through table separately
|
||||||
|
with connection.schema_editor() as editor:
|
||||||
|
editor.remove_field(BookWithM2M, BookWithM2M._meta.get_field_by_name("uniques")[0])
|
||||||
# Cleanup model states
|
# Cleanup model states
|
||||||
BookWithM2M._meta.local_many_to_many.remove(new_field)
|
BookWithM2M._meta.local_many_to_many.remove(new_field)
|
||||||
del BookWithM2M._meta._m2m_cache
|
del BookWithM2M._meta._m2m_cache
|
||||||
|
|
Loading…
Reference in New Issue