From 51771ba2e2fe344740b58a492092c07f43d88750 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 12 Jan 2025 04:22:22 +0100 Subject: [PATCH] improve test --- tests/models/test_model_copying.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/models/test_model_copying.py b/tests/models/test_model_copying.py index 25539d50..60fc0a3c 100644 --- a/tests/models/test_model_copying.py +++ b/tests/models/test_model_copying.py @@ -58,6 +58,8 @@ class Meta: through = models2.get_model("Cart").meta.fields["products"].through assert through is models2.get_model(through.__name__) assert through is not models.get_model(through.__name__) + for reg in [models, models2]: + assert "ThroughModel" not in reg.models @pytest.mark.parametrize("unlink_same_registry", [True, False]) @@ -110,6 +112,7 @@ class Meta: through = models2.get_model("Cart").meta.fields["products"].through assert through is models2.get_model(through.__name__) assert through is not models.get_model(through.__name__) + assert through.__name__ == "ThroughModel" @pytest.mark.parametrize("unlink_same_registry", [True, False]) @@ -166,3 +169,4 @@ class Meta: through = models2.get_model("Cart").meta.fields["products"].through assert through is models2.get_model(through.__name__) assert through is not models3.get_model(through.__name__) + assert through.__name__ == "ThroughModel"