mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fix some small errors in the tests
This commit is contained in:
@@ -127,12 +127,13 @@ class OperationTests(MigrationTestBase):
|
||||
self.assertTableExists("test_adflmm_pony_stables")
|
||||
self.assertColumnNotExists("test_adflmm_pony", "stables")
|
||||
# Make sure the M2M field actually works
|
||||
app_cache = new_state.render()
|
||||
Pony = app_cache.get_model("test_adflmm", "Pony")
|
||||
p = Pony.objects.create(pink=False, weight=4.55)
|
||||
p.stables.create()
|
||||
self.assertEqual(p.stables.count(), 1)
|
||||
p.stables.all().delete()
|
||||
with atomic():
|
||||
app_cache = new_state.render()
|
||||
Pony = app_cache.get_model("test_adflmm", "Pony")
|
||||
p = Pony.objects.create(pink=False, weight=4.55)
|
||||
p.stables.create()
|
||||
self.assertEqual(p.stables.count(), 1)
|
||||
p.stables.all().delete()
|
||||
# And test reversal
|
||||
with connection.schema_editor() as editor:
|
||||
operation.database_backwards("test_adflmm", editor, new_state, project_state)
|
||||
|
||||
Reference in New Issue
Block a user