diff --git a/tests/migrations/test_autodetector.py b/tests/migrations/test_autodetector.py
index 3d82207..2d45dac 100644
a
|
b
|
class AutodetectorTests(TestCase):
|
127 | 127 | ("id", models.AutoField(primary_key=True)), |
128 | 128 | ("publishers", models.ManyToManyField("testapp.Publisher")), |
129 | 129 | ]) |
| 130 | author_with_m2m_blank = ModelState("testapp", "Author", [ |
| 131 | ("id", models.AutoField(primary_key=True)), |
| 132 | ("publishers", models.ManyToManyField("testapp.Publisher", blank=True)), |
| 133 | ]) |
130 | 134 | author_with_m2m_through = ModelState("testapp", "Author", [ |
131 | 135 | ("id", models.AutoField(primary_key=True)), |
132 | 136 | ("publishers", models.ManyToManyField("testapp.Publisher", through="testapp.Contract")), |
… |
… |
class AutodetectorTests(TestCase):
|
1263 | 1267 | self.assertOperationTypes(changes, 'testapp', 0, ["AddField"]) |
1264 | 1268 | self.assertOperationAttributes(changes, 'testapp', 0, 0, name="publishers") |
1265 | 1269 | |
| 1270 | def test_alter_many_to_many(self): |
| 1271 | before = self.make_project_state([self.author_with_m2m, self.publisher]) |
| 1272 | after = self.make_project_state([self.author_with_m2m_blank, self.publisher]) |
| 1273 | autodetector = MigrationAutodetector(before, after) |
| 1274 | changes = autodetector._detect_changes() |
| 1275 | # Right number/type of migrations? |
| 1276 | self.assertNumberMigrations(changes, 'testapp', 1) |
| 1277 | self.assertOperationTypes(changes, 'testapp', 0, ["AlterField"]) |
| 1278 | self.assertOperationAttributes(changes, 'testapp', 0, 0, name="publishers") |
| 1279 | |
1266 | 1280 | def test_create_with_through_model(self): |
1267 | 1281 | """ |
1268 | 1282 | Adding a m2m with a through model and the models that use it should be |