Initial commit
This commit is contained in:
0
app/test/__init__.py
Normal file
0
app/test/__init__.py
Normal file
23
app/test/fixtures.py
Normal file
23
app/test/fixtures.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import pytest
|
||||
|
||||
from fte import create_app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app():
|
||||
return create_app('test')
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client(app):
|
||||
return app.test_client()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def db(app):
|
||||
from fte import db
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
yield db
|
||||
db.drop_all()
|
||||
db.session.commit()
|
Reference in New Issue
Block a user