backup
This commit is contained in:
parent
c58b6449aa
commit
2227554977
@ -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
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user