From d0e245d63e014d268310976fc45429f08d2cbbe9 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Wed, 19 Aug 2026 19:49:55 +0200 Subject: refactor(core): improve typing and test coverage Restructure database and user CLI commands, make passwords write-only model properties, and use the UTC datetime constant throughout the application. Add PEP 287-style documentation and expand receiver, scanner, sender, and URL security tests to cover error paths and edge cases. --- tests/test_views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/test_views.py') diff --git a/tests/test_views.py b/tests/test_views.py index aac281e..67ed190 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -1,5 +1,5 @@ import uuid -from datetime import datetime, timezone +from datetime import UTC, datetime from unittest.mock import Mock, call, patch import pytest @@ -19,7 +19,7 @@ from webmentions_ssg.models import ( def log_in(app: Flask, client: FlaskClient) -> None: with app.app_context(): - user = User(username="admin") + user = User(username="admin", password="test") db.session.add(user) db.session.commit() @@ -32,7 +32,7 @@ def log_in(app: Flask, client: FlaskClient) -> None: def create_sent_source(app: Flask) -> uuid.UUID: - now = datetime.now(timezone.utc) + now = datetime.now(UTC) with app.app_context(): source = Source( -- cgit v1.3.1