Add checkcookie redirect handling#1
Merged
frwickst merged 4 commits intofrwickst:mainfrom Aug 13, 2025
Merged
Conversation
Owner
|
Thank you for this. I will try to find the time to confirm that this does not break the Turku workflow today, and then we can merge this 👍 |
Owner
|
Looks good, and works for me still, so we can continue with merging this after some of the tests are passing. There were some issues already in Could you rebase on |
Fixed 3 ruff B023 errors in wilhelmina/tests/test_client.py where the get_side_effect function was referencing loop variables that could change during iteration. Resolved by capturing the loop variables as default function parameters to properly bind them in the closure.
Contributor
Author
|
Fixed the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checkcookie redirect handling
This fixes frwickst/wilma_ha#1
https://pirkkala.inschool.fi/?checkcookieinstead of directly providing a URL with the user ID format likehttps://server/!userid./pywilma/wilhelmina/client.pyto handle the checkcookie redirect by:Added Tests:
test_login_checkcookie_style_checkcookie_redirect- Tests the main scenario where:?checkcookie(without user ID)test_login_checkcookie_style_no_redirect_from_checkcookie- Tests when checkcookie returns status 200 instead of redirectingtest_login_checkcookie_style_user_id_extraction_patterns- Tests different regex patterns for extracting user ID from HTML:var url = "/!1234567/messages"(URL in quotes)userId = "!1234567"(variable assignment)test_login_checkcookie_style_extraction_failure- Tests error handling when user ID cannot be found in home pageResult: