import pytest
from app import create_app, db as _db
import config
@pytest.fixture
def app(tmp_path):
config.DATA_DIR = str(tmp_path / "data")
config.IMAGES_DIR = str(tmp_path / "data" / "images")
config.ISSUES_DIR = str(tmp_path / "data" / "issues")
config.SQLALCHEMY_DATABASE_URI = f"sqlite:///{tmp_path / 'test.db'}"
app = create_app(start_scheduler=False)
app.config["TESTING"] = True
with app.app_context():
_db.create_all()
yield app
_db.drop_all()
@pytest.fixture
def client(app):
return app.test_client()
@pytest.fixture
def db(app):
with app.app_context():
yield _db
SAMPLE_RSS_XML = """
]]>