import pytest | |
from app import create_app | |
@pytest.fixture | |
def client(): | |
app = create_app() | |
app.config['TESTING'] = True | |
return app.test_client() | |
def test_index(client): | |
rv = client.get('/') | |
assert rv.status_code == 200 | |
json_data = rv.get_json() | |
assert json_data['message'] == 'Hello, Flask!' |