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 = """ Plymouth Independent Test Article One https://example.com/article-1 Mon, 06 Apr 2026 12:00:00 +0000 https://example.com/?p=1001 First article content.

]]>
Test Article Two https://example.com/article-2 Tue, 07 Apr 2026 09:00:00 +0000 https://example.com/?p=1002 Second article content.

]]>
"""