aboutsummaryrefslogtreecommitdiff
path: root/tests/test_config.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-16 22:21:19 +0100
committerDennis Fink2026-11-16 22:21:19 +0100
commit354a5b449077478b141683bafbab47c9dc169d21 (patch)
treeb2d0be9cb848faf2f9944bb69a63f9fd9a857dbd /tests/test_config.py
parentf7d846b66ae4286518ecc20537ba19c5afadf7f4 (diff)
downloadwebmentions-ssg-354a5b449077478b141683bafbab47c9dc169d21.tar.gz
webmentions-ssg-354a5b449077478b141683bafbab47c9dc169d21.zip
feat(receiver): add sorting and page size controls
Allow received Webmentions to be sorted by status, source, target, received time, or updated time with stable pagination and accessible sortable headers. Add configurable per-page sizing and preserve sorting, filters, and page size across pagination and administrative actions.
Diffstat (limited to '')
-rw-r--r--tests/test_config.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index a4c5e9b..d075e7d 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -354,11 +354,18 @@ def test_resource_limits_have_safe_defaults() -> None:
assert DefaultConfig.MAX_CONTENT_LENGTH == 64 * 1024
assert DefaultConfig.MAX_WEBMENTION_URL_BYTES == 8192
assert DefaultConfig.RECEIVED_RETENTION_DAYS == 30
+ assert DefaultConfig.RECEIVED_MAX_PAGE_SIZE == 100
assert DefaultConfig.RECEIVED_RETENTION_SCHEDULE == "0 3 * * *"
@pytest.mark.parametrize(
- "key", ["MAX_CONTENT_LENGTH", "MAX_WEBMENTION_URL_BYTES", "RECEIVED_RETENTION_DAYS"]
+ "key",
+ [
+ "MAX_CONTENT_LENGTH",
+ "MAX_WEBMENTION_URL_BYTES",
+ "RECEIVED_RETENTION_DAYS",
+ "RECEIVED_MAX_PAGE_SIZE",
+ ],
)
@pytest.mark.parametrize("value", [None, "100", 0, -1, 1.5])
def test_invalid_resource_limits_fail_at_startup(
@@ -372,6 +379,18 @@ def test_invalid_resource_limits_fail_at_startup(
create_app(InvalidResourceLimit)
+def test_received_max_page_size_can_be_set_in_cfg(tmp_path: Path) -> None:
+ config_file = tmp_path / "development.cfg"
+ config_file.write_text("RECEIVED_MAX_PAGE_SIZE = 250\n")
+
+ class ConfiguredDevelopment(DevelopmentConfig):
+ CONFIG_FILE = str(config_file)
+ LOG_FILE = str(tmp_path / "development.log")
+
+ app = create_app(ConfiguredDevelopment)
+ assert app.config["RECEIVED_MAX_PAGE_SIZE"] == 250
+
+
def test_proxy_fix_disabled_by_default(tmp_path: Path) -> None:
class DirectConfig(TestingConfig):
LOG_FILE = str(tmp_path / "direct.log")