import pytest
from rifaserver.app import create_app
from rifaserver.models import db as _db

@pytest.fixture(scope='module')
def test_app():
    app = create_app('testing')
    with app.app_context():
        yield app

@pytest.fixture(scope='module')
def test_db(test_app):
    _db.app = test_app
    _db.create_all()
    yield _db
    _db.drop_all()
