diff --git a/tin/apps/assignments/tests/test_file_actions.py b/tin/apps/assignments/tests/test_file_actions.py index c7166a33..ca70e5da 100644 --- a/tin/apps/assignments/tests/test_file_actions.py +++ b/tin/apps/assignments/tests/test_file_actions.py @@ -44,7 +44,7 @@ def test_create_file_action_view(client, course) -> None: fa_data = model_to_dict(file_action) # try copying the data - response = client.post(f"{url}?action={file_action.id}", {**fa_data, "copy": True}) + response = client.post(f"{url}?action={file_action.id}", fa_data | {"copy": True}) assert ( course.file_actions.count() == 2 ), "Passing copy as a POST parameter should copy the file action" @@ -54,6 +54,11 @@ def test_create_file_action_view(client, course) -> None: file_action.refresh_from_db() assert file_action.name == "New name!" + response = client.post(f"{url}?copy=1", fa_data) + assert ( + course.file_actions.count() == 3 + ), f"Passing copy without an action should create a file action (got {response})" + @login("teacher") def test_delete_file_action_view(client, course, file_action) -> None: