1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #23121: AlterModelOptions operation not changing state right

This commit is contained in:
Andrew Godwin
2014-07-28 10:47:28 -07:00
parent cb60d22bd9
commit d6e73a876d
4 changed files with 45 additions and 18 deletions

View File

@@ -897,6 +897,13 @@ class AutodetectorTests(TestCase):
self.assertNumberMigrations(changes, "testapp", 1)
# Right actions in right order?
self.assertOperationTypes(changes, "testapp", 0, ["AlterModelOptions"])
# Changing them back to empty should also make a change
before = self.make_project_state([self.author_with_options])
after = self.make_project_state([self.author_empty])
autodetector = MigrationAutodetector(before, after)
changes = autodetector._detect_changes()
self.assertNumberMigrations(changes, "testapp", 1)
self.assertOperationTypes(changes, "testapp", 0, ["AlterModelOptions"])
def test_alter_model_options_proxy(self):
"""