Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvanrun committed Feb 25, 2025
1 parent 87436ef commit 5cdee10
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions app/tests/reader_studies_tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,21 +944,34 @@ def test_ground_truth_view(client):
for usr in [reader, a_user]:
response = get_view_for_user(
client=client,
viewname="reader-studies:ground_truth",
viewname="reader-studies:ground-truth",
reverse_kwargs={"slug": rs.slug},
user=usr,
)
assert response.status_code == 404
assert response.status_code == 403

response = get_view_for_user(
client=client,
viewname="reader-studies:ground_truth",
viewname="reader-studies:ground-truth",
reverse_kwargs={"slug": rs.slug},
user=editor,
)

educational_warning = (
"This reader study is currently not configured as educational"
)
assert response.status_code == 200
assert (
"Reader study is currently not configured as editorial and ground truths are not used"
in response.content
assert educational_warning in response.content.decode()

rs.is_educational = True
rs.save()

response = get_view_for_user(
client=client,
viewname="reader-studies:ground-truth",
reverse_kwargs={"slug": rs.slug},
user=editor,
)

assert response.status_code == 200
assert educational_warning not in response.content.decode()

0 comments on commit 5cdee10

Please sign in to comment.