Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
devkral committed Jan 12, 2025
1 parent e8bb6ae commit 51771ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/models/test_model_copying.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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"

0 comments on commit 51771ba

Please sign in to comment.