fixed tests not running

This commit is contained in:
2020-05-14 13:54:19 +02:00
parent 32648d0f7a
commit b226256187
7 changed files with 43 additions and 37 deletions

View File

@@ -1,16 +1,16 @@
import json
import os
import db
import pytest
from flask import current_app
@pytest.fixture
def client():
current_app.config['TESTING'] = True
def client(mocker):
mocker.patch("db.redis_client")
db.redis_client.get.side_effect=lambda a: None
with current_app.test_client() as client:
from app import app
app.config['TESTING'] = True
with app.test_client() as client:
yield client
@@ -22,9 +22,9 @@ def test_log_code_get(client):
def test_log_code_post(client):
data = {
"uuid": os.environ["LOCAL_UUID"],
"uuid": "asdasdasd",
"message": "Hello There!"
}
r = client.post('/log', data = json.dumps(data))
r = client.post('/log', json=data)
assert r.status_code == 204