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

test: remove tests for creating & deleting notes

parent e0040cf4
No related branches found
No related tags found
No related merge requests found
Pipeline #8357 passed
import pytest import pytest
from conftest import assert_data from conftest import assert_data
from program.models import LinkType, Note, TimeSlot from program.models import LinkType, TimeSlot
from program.tests.factories import NoteFactory from program.tests.factories import NoteFactory
pytestmark = pytest.mark.django_db pytestmark = pytest.mark.django_db
...@@ -37,39 +37,6 @@ def test_read_notes_as_unauthenticated_user(api_client): ...@@ -37,39 +37,6 @@ def test_read_notes_as_unauthenticated_user(api_client):
assert len(response.data) == NOTES assert len(response.data) == NOTES
@pytest.mark.django_db(transaction=True)
def test_create_note_for_owned_show_fails_if_it_exists(
user_with_note_perms, api_client_note_perms, owned_show_once_timeslot_perms
):
data = note_data(timeslot=owned_show_once_timeslot_perms)
response = api_client_note_perms.post(url(), data=data)
assert response.status_code == 400
def test_create_note_for_owned_show(
user_with_note_perms, api_client_note_perms, owned_show_once_timeslot_perms
):
Note.objects.get(pk=owned_show_once_timeslot_perms.note.id).delete()
data = note_data(timeslot=owned_show_once_timeslot_perms)
response = api_client_note_perms.post(url(), data=data)
assert response.status_code == 201
def test_create_note_not_found_for_not_owned_show(
user_with_note_perms, api_client_note_perms, show_once_timeslot
):
data = note_data(timeslot=show_once_timeslot)
response = api_client_note_perms.patch(url(note=show_once_timeslot.note), data=data)
assert response.status_code == 404
def test_update_note_for_owned_show( def test_update_note_for_owned_show(
user_with_note_perms, api_client_note_perms, owned_show_once_timeslot_perms user_with_note_perms, api_client_note_perms, owned_show_once_timeslot_perms
): ):
...@@ -109,19 +76,3 @@ def test_update_note_links( ...@@ -109,19 +76,3 @@ def test_update_note_links(
assert response.status_code == 200 assert response.status_code == 200
assert_data(response, update) assert_data(response, update)
def test_delete_note_for_owned_show(
user_with_note_perms, api_client_note_perms, owned_show_once_timeslot_perms
):
response = api_client_note_perms.delete(url(note=owned_show_once_timeslot_perms.note))
assert response.status_code == 204
def test_delete_note_not_found_for_not_owned_show(
user_with_note_perms, api_client_note_perms, once_timeslot
):
response = api_client_note_perms.delete(url(note=once_timeslot.note))
assert response.status_code == 404
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment