2020-07-08 15:10:00 +00:00
|
|
|
# Copyright (C) 2020 by Maike <maike@systemli.org>
|
2020-07-17 13:47:55 +00:00
|
|
|
# Copyright (C) 2020 by Thomas Lindner <tom@dl6tom.de>
|
2020-09-28 22:39:32 +00:00
|
|
|
# Copyright (C) 2020 by Martin Rey <martin.rey@mailbox.org>
|
2020-07-08 15:10:00 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: 0BSD
|
|
|
|
|
|
|
|
from fastapi import status
|
|
|
|
|
|
|
|
|
|
|
|
def test_email_create_unauthorized(client, hood_id):
|
2020-09-28 22:39:32 +00:00
|
|
|
response = client.post('/api/hoods/{0}/email/'.format(hood_id))
|
2020-07-08 15:10:00 +00:00
|
|
|
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|
|
|
|
|
|
|
|
|
2020-07-11 02:29:44 +00:00
|
|
|
def test_email_delete_unauthorized(client, hood_id, email_row):
|
2020-10-12 20:47:06 +00:00
|
|
|
response = client.delete(
|
|
|
|
'/api/hoods/{0}/email/{1}'.format(hood_id, email_row['id'])
|
|
|
|
)
|
2020-07-11 02:29:44 +00:00
|
|
|
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|
|
|
|
|
|
|
|
|
|
|
|
def test_email_message_unauthorized(client, hood_id, email_row):
|
2020-10-13 08:12:35 +00:00
|
|
|
body = {'text': 'test', 'author': 'author', 'secret': 'wrong'}
|
2020-09-28 22:39:32 +00:00
|
|
|
response = client.post('/api/hoods/{0}/email/messages/'.format(hood_id), json=body)
|
2020-07-08 15:10:00 +00:00
|
|
|
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|