Skip to content

Commit

Permalink
Do not run test_manager_instance_access with abstract models on Dja…
Browse files Browse the repository at this point in the history
…ngo 3.2+
  • Loading branch information
Stranger6667 committed Dec 29, 2020
1 parent 4aa84f8 commit 5b9cde3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,14 @@ def test_ne_currency(self):
assert Money(10, "EUR") != Money(10, "USD")


@pytest.mark.parametrize(
"model_class", (AbstractModel, ModelWithNonMoneyField, InheritorModel, InheritedModel, ProxyModel)
)
INSTANCE_ACCESS_MODELS = [ModelWithNonMoneyField, InheritorModel, InheritedModel, ProxyModel]

if VERSION[:2] < (3, 2):
# Django 3.2 and later does not support AbstractModel instancing
INSTANCE_ACCESS_MODELS.append(AbstractModel)


@pytest.mark.parametrize("model_class", INSTANCE_ACCESS_MODELS)
def test_manager_instance_access(model_class):
with pytest.raises(AttributeError):
model_class().objects.all()
Expand Down

0 comments on commit 5b9cde3

Please sign in to comment.