This commit is contained in:
Füleki Fábián 2020-05-08 21:02:49 +02:00
parent c58b6449aa
commit 2227554977
2 changed files with 18 additions and 2 deletions

View File

@ -4,7 +4,13 @@ from flask import current_app
@pytest.fixture @pytest.fixture
def client():
current_app.config['TESTING'] = True
with current_app.test_client() as client:
yield
def test_response_length(client): def test_response_length(client):
r = client.get('/log') r = client.post('/log')
assert len(r) == 0 assert len(r) == 0

View File

@ -4,8 +4,18 @@ from flask import current_app
@pytest.fixture @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') r = client.get('/log')
assert r.status_code == 204 assert r.status_code == 204