diff --git a/app/feedback/filters/feedback.py b/app/feedback/filters/feedback.py index bfc8dec3..96360c5a 100644 --- a/app/feedback/filters/feedback.py +++ b/app/feedback/filters/feedback.py @@ -13,11 +13,9 @@ class FeedbackFilter(filters.FilterSet): method="filter_feedback_type", label="List of feedback type" ) - status = filters.ModelChoiceFilter( + status = filters.CharFilter( method="filter_status", - field_name="status", label="List of feedback status", - queryset=Feedback.objects.all(), ) ordering = OrderingFilter( diff --git a/app/tests/feedback/test_feedback_integration.py b/app/tests/feedback/test_feedback_integration.py index 226913f0..ffe4d360 100644 --- a/app/tests/feedback/test_feedback_integration.py +++ b/app/tests/feedback/test_feedback_integration.py @@ -280,7 +280,7 @@ def test_status_filter_as_member(member): """A member should be able to filter feedbacks by status""" BugFactory(author=member, status=Status.OPEN) - IdeaFactory(author=member, status=Status.OPEN) + IdeaFactory(author=member, status=Status.CLOSED) url = f"{FEEDBACK_BASE_URL}?status={Status.OPEN}" client = get_api_client(member) @@ -288,11 +288,8 @@ def test_status_filter_as_member(member): data = response.data - print(data) - results = data["results"] assert response.status_code == status.HTTP_200_OK - assert data["count"] == 2 + assert data["count"] == 1 assert results[0]["status"] == Status.OPEN - assert results[1]["status"] == Status.OPEN