def test_create_model_add_field_not_through_fk(self):
        self.assertOptimizesTo(
            [
                migrations.CreateModel("Foo", [("name", models.CharField(max_length=255))]),
                migrations.CreateModel("Link", [("url", models.TextField())]),
                migrations.AddField("Foo", "link", models.ForeignKey("migrations.Link", models.CASCADE)),
            ],
            [
                migrations.CreateModel("Foo", [("name", models.CharField(max_length=255))]),
                migrations.CreateModel("Link", [("url", models.TextField())]),
                migrations.AddField("Foo", "link", models.ForeignKey("migrations.Link", models.CASCADE)),
            ],
        )
AddField should NOT optimize into CreateModel if it's an FK to a model
dataset/ETHPy150Open django/django/tests/migrations/test_optimizer.py/OptimizerTests.test_create_model_add_field_not_through_fk