Skip to content

Commit

Permalink
test: add separate test for unvoting without authentication
Browse files Browse the repository at this point in the history
Refs: KER-368
  • Loading branch information
charn committed Aug 27, 2024
1 parent 89aa789 commit 252d1e3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions democracy/tests/integrationtest/test_comment_vote.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ def test_31_section_comment_vote_add_second_vote(john_doe_api_client, default_he


@pytest.mark.django_db
def test_section_comment_unvote(api_client, john_doe_api_client, default_hearing):
def test_section_comment_unvote(john_doe_api_client, default_hearing):
section, comment = add_default_section_and_comment(default_hearing)
response = api_client.post(get_section_comment_unvote_url(default_hearing.id, section.id, comment.id))
assert response.status_code == 403

john_doe_api_client.post(get_section_comment_vote_url(default_hearing.id, section.id, comment.id))
response = john_doe_api_client.post(get_section_comment_unvote_url(default_hearing.id, section.id, comment.id))
Expand All @@ -114,6 +112,13 @@ def test_section_comment_unvote(api_client, john_doe_api_client, default_hearing
assert response.status_code == 304


@pytest.mark.django_db
def test_section_comment_unvote_without_authentication(api_client, default_hearing):
section, comment = add_default_section_and_comment(default_hearing)
response = api_client.post(get_section_comment_unvote_url(default_hearing.id, section.id, comment.id))
assert response.status_code == 403


@pytest.mark.django_db
def test_vote_appears_in_user_data(john_doe_api_client, default_hearing):
section, sc_comment = add_default_section_and_comment(default_hearing)
Expand Down

0 comments on commit 252d1e3

Please sign in to comment.