From 472aaa5cde168a046d1c536025e8dd6ab4d8427e Mon Sep 17 00:00:00 2001 From: Tom Wojcik Date: Sun, 10 Nov 2024 12:55:12 +0100 Subject: [PATCH] fix CI --- .../testapp/tests/test_urls/test_urls.py | 10 ++-- .../tests/test_urls/urls_snapshot.json | 60 +++++++++---------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/testproject/testapp/tests/test_urls/test_urls.py b/testproject/testapp/tests/test_urls/test_urls.py index ac50f38a..39195e35 100644 --- a/testproject/testapp/tests/test_urls/test_urls.py +++ b/testproject/testapp/tests/test_urls/test_urls.py @@ -19,12 +19,12 @@ def test_urls_have_not_changed(settings): # Function to normalize URL patterns by removing trailing \Z # otherwise fails in CI def normalize_pattern(pattern): - # Remove trailing \Z and any format suffix - pattern = re.sub(r"\\Z$", "", pattern) # Remove trailing \Z + # Remove trailing \Z + pattern = re.sub(r"\\Z$", "", pattern) + # Remove any format suffixes by identifying "format" capture groups, with or without leading period # noqa: E501 pattern = re.sub( - r"\(\?P\\.[a-z0-9]+\(/\)?\)?", "", pattern - ) # Remove format suffixes - pattern = re.sub(r"\$\Z", "", pattern) # Remove any remaining `$` markers + r"\(\?P\\?\.[a-z0-9]+\(\?/?\)?\)", "", pattern + ) # noqa: E501 return pattern def get_all_urls(patterns, prefix=""): diff --git a/testproject/testapp/tests/test_urls/urls_snapshot.json b/testproject/testapp/tests/test_urls/urls_snapshot.json index e352b535..7ebdf2a3 100644 --- a/testproject/testapp/tests/test_urls/urls_snapshot.json +++ b/testproject/testapp/tests/test_urls/urls_snapshot.json @@ -20,123 +20,123 @@ "name": "jwt-verify" }, { - "pattern": "^auth/^o/(?P\\S+)/", + "pattern": "^auth/^o/(?P\\S+)/$", "name": "provider-auth" }, { - "pattern": "^auth/^token/login/?", + "pattern": "^auth/^token/login/?$", "name": "login" }, { - "pattern": "^auth/^token/logout/?", + "pattern": "^auth/^token/logout/?$", "name": "logout" }, { - "pattern": "^auth/^users/", + "pattern": "^auth/^users/$", "name": "user-list" }, { - "pattern": "^auth/^users/(?P[^/.]+)/", + "pattern": "^auth/^users/(?P[^/.]+)/$", "name": "user-detail" }, { - "pattern": "^auth/^users/(?P[^/.]+)\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users/(?P[^/.]+)\\.(?P[a-z0-9]+)/?$", "name": "user-detail" }, { - "pattern": "^auth/^users/activation/", + "pattern": "^auth/^users/activation/$", "name": "user-activation" }, { - "pattern": "^auth/^users/activation\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users/activation\\.(?P[a-z0-9]+)/?$", "name": "user-activation" }, { - "pattern": "^auth/^users/me/", + "pattern": "^auth/^users/me/$", "name": "user-me" }, { - "pattern": "^auth/^users/me\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users/me\\.(?P[a-z0-9]+)/?$", "name": "user-me" }, { - "pattern": "^auth/^users/resend_activation/", + "pattern": "^auth/^users/resend_activation/$", "name": "user-resend-activation" }, { - "pattern": "^auth/^users/resend_activation\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users/resend_activation\\.(?P[a-z0-9]+)/?$", "name": "user-resend-activation" }, { - "pattern": "^auth/^users/reset_password/", + "pattern": "^auth/^users/reset_password/$", "name": "user-reset-password" }, { - "pattern": "^auth/^users/reset_password\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users/reset_password\\.(?P[a-z0-9]+)/?$", "name": "user-reset-password" }, { - "pattern": "^auth/^users/reset_password_confirm/", + "pattern": "^auth/^users/reset_password_confirm/$", "name": "user-reset-password-confirm" }, { - "pattern": "^auth/^users/reset_password_confirm\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users/reset_password_confirm\\.(?P[a-z0-9]+)/?$", "name": "user-reset-password-confirm" }, { - "pattern": "^auth/^users/reset_username/", + "pattern": "^auth/^users/reset_username/$", "name": "user-reset-username" }, { - "pattern": "^auth/^users/reset_username\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users/reset_username\\.(?P[a-z0-9]+)/?$", "name": "user-reset-username" }, { - "pattern": "^auth/^users/reset_username_confirm/", + "pattern": "^auth/^users/reset_username_confirm/$", "name": "user-reset-username-confirm" }, { - "pattern": "^auth/^users/reset_username_confirm\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users/reset_username_confirm\\.(?P[a-z0-9]+)/?$", "name": "user-reset-username-confirm" }, { - "pattern": "^auth/^users/set_password/", + "pattern": "^auth/^users/set_password/$", "name": "user-set-password" }, { - "pattern": "^auth/^users/set_password\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users/set_password\\.(?P[a-z0-9]+)/?$", "name": "user-set-password" }, { - "pattern": "^auth/^users/set_username/", + "pattern": "^auth/^users/set_username/$", "name": "user-set-username" }, { - "pattern": "^auth/^users/set_username\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users/set_username\\.(?P[a-z0-9]+)/?$", "name": "user-set-username" }, { - "pattern": "^auth/^users\\.(?P[a-z0-9]+)/?", + "pattern": "^auth/^users\\.(?P[a-z0-9]+)/?$", "name": "user-list" }, { - "pattern": "^webauthn-example/", + "pattern": "^webauthn-example/$", "name": null }, { - "pattern": "^webauthn/^login/", + "pattern": "^webauthn/^login/$", "name": "webauthn_login" }, { - "pattern": "^webauthn/^login_request/", + "pattern": "^webauthn/^login_request/$", "name": "webauthn_login_request" }, { - "pattern": "^webauthn/^signup/(?P.+)/", + "pattern": "^webauthn/^signup/(?P.+)/$", "name": "webauthn_signup" }, { - "pattern": "^webauthn/^signup_request/", + "pattern": "^webauthn/^signup_request/$", "name": "webauthn_signup_request" } ]