From 74d9afbfd1736b0c5844ca5220c6fafb68b33c53 Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Fri, 16 Oct 2026 00:23:35 +0400 Subject: [PATCH] List user policies within the page limit in the live staging test _policy_ids asked GET /v2/user-policies for limit=1000, but the Public API caps limit at MAXIMUM_QUERY_LIMIT (500), so the request got 422 and the signed-out round-trip test failed. That test gates the staging deploy, so every merge to master stopped before production. The helper now asks for MAXIMUM_QUERY_LIMIT. Fixes #3943 Co-Authored-By: Claude Opus 5.5 --- changelog.d/fix-live-test-user-policy-page-limit.fixed.md | 1 + tests/integration/test_live_v2_policies.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog.d/fix-live-test-user-policy-page-limit.fixed.md diff --git a/changelog.d/fix-live-test-user-policy-page-limit.fixed.md b/changelog.d/fix-live-test-user-policy-page-limit.fixed.md new file mode 100644 index 000000000..c6b7d57a7 --- /dev/null +++ b/changelog.d/fix-live-test-user-policy-page-limit.fixed.md @@ -0,0 +1 @@ +The live staging test lists a browser's saved policies within the Public API's page limit, so the staging deploy's integration step can pass. diff --git a/tests/integration/test_live_v2_policies.py b/tests/integration/test_live_v2_policies.py index 83005f14b..9a94f142f 100644 --- a/tests/integration/test_live_v2_policies.py +++ b/tests/integration/test_live_v2_policies.py @@ -33,6 +33,8 @@ import httpx import pytest +from policyengine_api.query_parameters import MAXIMUM_QUERY_LIMIT + AUTH0_ENVIRONMENT = ( "STAGING_AUTH0_TEST_DOMAIN", "STAGING_AUTH0_TEST_AUDIENCE", @@ -170,7 +172,7 @@ def _save_policy(api_client, headers: dict[str, str], legacy_policy_id: int) -> def _policy_ids(api_client, headers: dict[str, str]) -> set[str]: response = api_client.get( "/v2/user-policies", - params={"country_id": COUNTRY_ID, "limit": 1000}, + params={"country_id": COUNTRY_ID, "limit": MAXIMUM_QUERY_LIMIT}, headers=headers, ) assert response.status_code == 200, response.text[:500]