Skip to content

test: Strengthen assertion in validation rate limit SAML pipeline exemption test#169

Closed
Copilot wants to merge 5 commits intojb/saml-auth-redirectfrom
copilot/sub-pr-155
Closed

test: Strengthen assertion in validation rate limit SAML pipeline exemption test#169
Copilot wants to merge 5 commits intojb/saml-auth-redirectfrom
copilot/sub-pr-155

Conversation

Copy link

Copilot AI commented Mar 6, 2026

Description

The assertion in RegistrationValidationViewTests.test_rate_limiting_exempted_for_saml_pipeline used status_code != 403, which would pass silently on a 500 or any other non-403 error — defeating the purpose of the test.

Changed:

  • assert response.status_code != 403self.assertHttpOK(response) (explicitly asserts 200)
  • Added assert response.json().get('validation_decisions') == {} to verify the expected response shape for an empty POST body, consistent with test_no_decision_for_empty_request

This matches the pattern already in place for the registration endpoint counterpart test (assertHttpOK + error code assertion).

Supporting information

Addresses feedback on #155.

Testing instructions

Run the targeted test:

pytest openedx/core/djangoapps/user_authn/views/tests/test_register.py::RegistrationValidationViewTests::test_rate_limiting_exempted_for_saml_pipeline

Deadline

None

Other information

Test-only change; no production code modified.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

jono-booth and others added 4 commits March 6, 2026 15:55
Co-authored-by: jono-booth <6801693+jono-booth@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback on SAML TPA redirect test: Strengthen assertion in validation rate limit SAML pipeline exemption test Mar 6, 2026
@jono-booth jono-booth force-pushed the jb/saml-auth-redirect branch from 6f1ee96 to 41ef966 Compare March 6, 2026 14:25
@jono-booth jono-booth closed this Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants