Skip to content

Commit

Permalink
Test blur count
Browse files Browse the repository at this point in the history
  • Loading branch information
juuso-j committed Mar 18, 2024
1 parent 7e2c8a6 commit ae872e4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions profiles/tests/api/test_postal_code_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@
ANSWER_URL = reverse("profiles:answer-list")


@pytest.mark.django_db
def test_blur_count(api_client, results):
postal_code_result = PostalCodeResult.objects.create(
count=5, result=results.first()
)
url = reverse("profiles:postalcoderesult-detail", args=[str(postal_code_result.id)])
response = api_client.get(url)
assert response.status_code == 200
assert response.json()["count"] == 0
postal_code_result.count = 6
postal_code_result.save()
response = api_client.get(url)
assert response.json()["count"] == 6


@pytest.mark.django_db
def test_postal_code_result_with_postal_code_and_optional_postal_code(
api_client, users, questions, options, results
Expand Down

0 comments on commit ae872e4

Please sign in to comment.