From 7f07e566eb49ec4356356767b8ca9d9c8e08db62 Mon Sep 17 00:00:00 2001 From: maike Date: Sat, 11 Jul 2020 04:31:02 +0200 Subject: [PATCH] [tests] Write email without trigger words --- tests/test_api_email_wrong.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_api_email_wrong.py b/tests/test_api_email_wrong.py index f620ee3..c1b818d 100644 --- a/tests/test_api_email_wrong.py +++ b/tests/test_api_email_wrong.py @@ -28,6 +28,18 @@ def test_email_subscribe_confirm_wrong_hood(client): assert response.json()['detail'] == 'Not Found' +def test_email_message_wrong(client, hood_id, email_row): + body = { + 'text': "", + 'author': "test@localhost", + 'secret': email_row['secret'], + } + response = client.post( + '/api/hoods/%d/email/messages/%d' % (hood_id, email_row['id']), json=body + ) + assert response.status_code == status.HTTP_451_UNAVAILABLE_FOR_LEGAL_REASONS + + def test_email_unsubscribe_wrong_token(client, hood_id): try: client.get(