[tests] Unauthorized: delete email bot, write message
This commit is contained in:
parent
1d55c45890
commit
77880e72f2
|
@ -10,6 +10,17 @@ def test_email_create_unauthorized(client, hood_id):
|
||||||
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|
||||||
|
|
||||||
|
|
||||||
def test_email_delete_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/%d' % (hood_id, email_row['id']), json=body
|
||||||
|
)
|
||||||
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|
||||||
|
|
Loading…
Reference in a new issue