From 22275549771e79ad36b8858a2e18ab3613a677c3 Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 8 May 2020 21:02:49 +0200 Subject: [PATCH] backup --- consumer_api/tests/consumers_view_test.py | 8 +++++++- consumer_api/tests/log_view_test.py | 12 +++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) 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