'AddField should NOT optimize into CreateModel if it\'s an M2M using a
through that\'s created between them.'

def test_create_model_add_field_not_through_m2m_through(self):

    self.assertDoesNotOptimize([migrations.CreateModel('Foo', [('name', models.CharField(max_length=255))]), migrations.CreateModel('LinkThrough', []), migrations.AddField('Foo', 'link', models.ManyToManyField('migrations.Link', through='migrations.LinkThrough'))])
