diff --git a/tests/test_api_email_happy_path.py b/tests/test_api_email_happy_path.py index 97db38f..27e18bc 100644 --- a/tests/test_api_email_happy_path.py +++ b/tests/test_api_email_happy_path.py @@ -18,10 +18,9 @@ def test_email_subscribe_unsubscribe(client, hood_id, receive_email): mail = receive_email() body = mail['body'] confirm_url = findall( - 'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', + r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', body, )[0] - print(urlparse(confirm_url).path) response = client.post(urlparse(confirm_url).path) assert response.status_code == status.HTTP_201_CREATED response = client.post(urlparse(confirm_url).path) diff --git a/tests/test_api_email_unauthorized.py b/tests/test_api_email_unauthorized.py index cc31ecc..5be5c8e 100644 --- a/tests/test_api_email_unauthorized.py +++ b/tests/test_api_email_unauthorized.py @@ -1,4 +1,5 @@ # Copyright (C) 2020 by Maike +# Copyright (C) 2020 by Thomas Lindner # # SPDX-License-Identifier: 0BSD @@ -11,13 +12,10 @@ def test_email_create_unauthorized(client, hood_id): def test_email_delete_unauthorized(client, hood_id, email_row): - response = client.delete('/api/hoods/%d/email/' % hood_id) + response = client.delete('/api/hoods/%d/email/%d' % (hood_id, email_row['id'])) assert response.status_code == status.HTTP_401_UNAUTHORIZED -# def test_email_delete_of_different_hood - - def test_email_message_unauthorized(client, hood_id, email_row): body = {"text": "test", "author": "author", "secret": "wrong"} response = client.post('/api/hoods/%d/email/messages/' % hood_id, json=body)