diff --git a/consumer_api/tests/consumers_view_test.py b/consumer_api/tests/consumers_view_test.py index 2a65149..fc1a9be 100644 --- a/consumer_api/tests/consumers_view_test.py +++ b/consumer_api/tests/consumers_view_test.py @@ -4,7 +4,13 @@ from flask import current_app @pytest.fixture +def client(): + current_app.config['TESTING'] = True + + with current_app.test_client() as client: + yield + def test_response_length(client): - r = client.get('/log') + r = client.post('/log') assert len(r) == 0 diff --git a/consumer_api/tests/log_view_test.py b/consumer_api/tests/log_view_test.py index 934b210..f102664 100644 --- a/consumer_api/tests/log_view_test.py +++ b/consumer_api/tests/log_view_test.py @@ -4,8 +4,18 @@ from flask import current_app @pytest.fixture +def client(): + current_app.config['TESTING'] = True -def test_log_code(client): + with current_app.test_client() as client: + yield + +def test_log_code_get(client): + r = client.get('/log') + + assert r.status_code == 405 + +def test_log_code_post(client): r = client.get('/log') assert r.status_code == 204