Skip to content
Snippets Groups Projects
Verified Commit c57fb3a7 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

test: add tests to set and clear the media description of an episode

parent dc2a61cc
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,7 @@ def user_with_episode_perms(request) -> User: ...@@ -43,6 +43,7 @@ def user_with_episode_perms(request) -> User:
"edit__episode__image", "edit__episode__image",
"edit__episode__contributors", "edit__episode__contributors",
"edit__episode__languages", "edit__episode__languages",
"edit__episode__media_description",
"edit__episode__tags", "edit__episode__tags",
"edit__episode__links", "edit__episode__links",
} }
...@@ -236,3 +237,20 @@ def test_episode_timeslot_ids_are_ordered_by_start_time( ...@@ -236,3 +237,20 @@ def test_episode_timeslot_ids_are_ordered_by_start_time(
response = admin_api_client.get(url(episode)) response = admin_api_client.get(url(episode))
# timeslot ids must be in order of start time # timeslot ids must be in order of start time
assert response.json()["timeslotIds"] == [first_ts.id, second_ts.id, third_ts.id] assert response.json()["timeslotIds"] == [first_ts.id, second_ts.id, third_ts.id]
def test_episode_set_media_description(api_client_episode_perms, _owned_show):
episode = EpisodeFactory.create(show=_owned_show)
update = {"mediaDescription": "a media description"}
response = api_client_episode_perms.patch(url(episode=episode), data=update)
assert response.json()["mediaDescription"] == update["mediaDescription"]
def test_episode_clear_media_description(api_client_episode_perms, _owned_show):
episode = EpisodeFactory.create(show=_owned_show)
response = api_client_episode_perms.patch(url(episode=episode), data={"mediaDescription": ""})
assert response.json()["mediaDescription"] == ""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment