diff --git a/tests/conftest.py b/tests/conftest.py index 67020b3..c3d80a0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -84,7 +84,7 @@ def hood_id(client, auth_header): @fixture(scope='function') def trigger_id(client, hood_id, auth_header): response = client.post( - '/api/hoods/%d/triggers/' % hood_id, json={'pattern': ''}, headers=auth_header + '/api/hoods/%d/triggers/' % hood_id, json={'pattern': 'te'}, headers=auth_header ) assert response.status_code == status.HTTP_201_CREATED trigger_id = int(response.headers['Location']) @@ -116,3 +116,14 @@ def test_id(client, hood_id, auth_header): test_id = int(response.headers['Location']) yield test_id client.delete('/api/hoods/%d/test/%d' % (hood_id, test_id), headers=auth_header) + + +@fixture(scope="function") +def email_row(client, hood_id, auth_header): + response = client.post('/api/hoods/%d/email/' % hood_id, headers=auth_header) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["hood"]["id"] == hood_id + email_row = response.json() + yield email_row + # not sure if necessary; it raises problems at least + # client.delete('/api/hoods/%d/email/' % hood_id, headers=auth_header)