Skip to content

Commit

Permalink
Test exception when both filterset_class and filter_fields are set
Browse files Browse the repository at this point in the history
  • Loading branch information
sierreis committed Mar 27, 2019
1 parent 132c4cb commit d2f8bf7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions graphene_django/filter/tests/test_fields.py
Expand Up @@ -227,6 +227,21 @@ class Query(ObjectType):
assert_not_orderable(articles_field)


def test_filter_filterset_class_filter_fields_exception():
with pytest.raises(Exception):
class ReporterFilter(FilterSet):
class Meta:
model = Reporter
fields = ["first_name", "articles"]

class ReporterFilterNode(DjangoObjectType):
class Meta:
model = Reporter
interfaces = (Node,)
filterset_class = ReporterFilter
filter_fields = ["first_name", "articles"]


def test_filter_filterset_class_information_on_meta():
class ReporterFilter(FilterSet):
class Meta:
Expand Down

0 comments on commit d2f8bf7

Please sign in to comment.