2020-07-19 12:13:15 +00:00
|
|
|
# Copyright (C) 2020 by Maike <maike@systemli.org>
|
|
|
|
# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
|
2020-09-28 22:39:32 +00:00
|
|
|
# Copyright (C) 2020 by Martin Rey <martin.rey@mailbox.org>
|
2020-07-19 12:13:15 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: 0BSD
|
|
|
|
|
|
|
|
|
|
|
|
from fastapi import status
|
|
|
|
from pytest import fixture
|
|
|
|
|
|
|
|
|
2023-03-18 17:47:02 +00:00
|
|
|
@fixture(scope="function")
|
2020-07-19 12:13:15 +00:00
|
|
|
def email_row(client, hood_id, auth_header):
|
|
|
|
response = client.post(
|
2023-03-18 17:47:02 +00:00
|
|
|
"/api/hoods/{0}/email/".format(hood_id),
|
|
|
|
json={"name": "kibicara-test"},
|
2020-07-19 12:13:15 +00:00
|
|
|
headers=auth_header,
|
|
|
|
)
|
|
|
|
assert response.status_code == status.HTTP_201_CREATED
|
2023-03-18 17:47:02 +00:00
|
|
|
email_id = int(response.headers["Location"])
|
2020-07-19 12:13:15 +00:00
|
|
|
yield response.json()
|
2020-10-12 20:47:06 +00:00
|
|
|
client.delete(
|
2023-03-18 17:47:02 +00:00
|
|
|
"/api/hoods/{0}/email/{1}".format(hood_id, email_id), headers=auth_header
|
2020-10-12 20:47:06 +00:00
|
|
|
)
|