diff options
Diffstat (limited to '')
| -rw-r--r-- | tests/test_init.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/test_init.py b/tests/test_init.py index 8f2bbb7..0966b19 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -14,12 +14,16 @@ from sqlalchemy import create_engine from webmentions_ssg import VERSION, create_app, db, huey from webmentions_ssg.config import TestingConfig from webmentions_ssg.net import is_http_url +from webmentions_ssg.template_filters import relative_time, utc_isoformat, utc_timestamp def test_create_app_registers_blueprint_and_extensions(app: Flask) -> None: assert "webmentions" in app.blueprints assert app.extensions["huey"] is huey assert app.jinja_env.filters["is_http_url"] is is_http_url + assert app.jinja_env.filters["relative_time"] is relative_time + assert app.jinja_env.filters["utc_isoformat"] is utc_isoformat + assert app.jinja_env.filters["utc_timestamp"] is utc_timestamp def test_create_app_exposes_version_in_templates(app: Flask) -> None: @@ -53,12 +57,9 @@ assert webmentions_bp.name == 'webmentions' def test_in_memory_sqlite_enforces_foreign_keys_without_wal(app: Flask) -> None: - with app.app_context(): - with db.engine.connect() as connection: - assert connection.exec_driver_sql("PRAGMA foreign_keys").scalar() == 1 - assert ( - connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "memory" - ) + with app.app_context(), db.engine.connect() as connection: + assert connection.exec_driver_sql("PRAGMA foreign_keys").scalar() == 1 + assert connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "memory" def test_file_sqlite_enables_wal_and_foreign_keys(tmp_path: Path) -> None: |
