'We should be able to optimize away create/delete through a create or delete
of a different model, but only if the create operation does not mention the model
at all.'

def test_optimize_through_create(self):

    self.assertOptimizesTo([migrations.CreateModel('Foo', [('name', models.CharField(max_length=255))]), migrations.CreateModel('Bar', [('size', models.IntegerField())]), migrations.DeleteModel('Foo')], [migrations.CreateModel('Bar', [('size', models.IntegerField())])])
    self.assertOptimizesTo([migrations.CreateModel('Foo', [('name', models.CharField(max_length=255))]), migrations.CreateModel('Bar', [('size', models.IntegerField())]), migrations.DeleteModel('Bar'), migrations.DeleteModel('Foo')], [])
    self.assertOptimizesTo([migrations.CreateModel('Foo', [('name', models.CharField(max_length=255))]), migrations.CreateModel('Bar', [('size', models.IntegerField())]), migrations.DeleteModel('Foo'), migrations.DeleteModel('Bar')], [])
    self.assertDoesNotOptimize([migrations.CreateModel('Foo', [('name', models.CharField(max_length=255))]), migrations.CreateModel('Bar', [('other', models.ForeignKey('testapp.Foo', models.CASCADE))]), migrations.DeleteModel('Foo')])
    self.assertOptimizesTo([migrations.CreateModel('Foo', [('name', models.CharField(max_length=255))]), migrations.CreateModel('Bar', [('other', models.ForeignKey('testapp.Foo', models.CASCADE))]), migrations.DeleteModel('Foo')], [migrations.CreateModel('Bar', [('other', models.ForeignKey('testapp.Foo', models.CASCADE))])], app_label='otherapp')
    self.assertDoesNotOptimize([migrations.CreateModel('Foo', [('name', models.CharField(max_length=255))]), migrations.CreateModel('Bar', [('other', models.ForeignKey('testapp.Foo', models.CASCADE))]), migrations.DeleteModel('Foo')], app_label='testapp')
    self.assertDoesNotOptimize([migrations.CreateModel('Foo', [('name', models.CharField(max_length=255))]), migrations.CreateModel('Bar', [('size', models.IntegerField())], bases=('testapp.Foo',)), migrations.DeleteModel('Foo')])
    self.assertOptimizesTo([migrations.CreateModel('Foo', [('name', models.CharField(max_length=255))]), migrations.CreateModel('Bar', [('size', models.IntegerField())], bases=('testapp.Foo',)), migrations.DeleteModel('Foo')], [migrations.CreateModel('Bar', [('size', models.IntegerField())], bases=('testapp.Foo',))], app_label='otherapp')
    self.assertDoesNotOptimize([migrations.CreateModel('Foo', [('name', models.CharField(max_length=255))]), migrations.CreateModel('Bar', [('size', models.IntegerField())], bases=('testapp.Foo',)), migrations.DeleteModel('Foo')], app_label='testapp')
