Repository navigation
Test that the add_blurb form renders - #477
Merged
Merged
Conversation
Mariatta
force-pushed
the
test-add-blurb-form
branch
2 times, most recently
from
October 22, 2026 00:48
46fb89a to
61ee440
Compare
No test requested GET /add_blurb, so a template error or a broken inline script in the form would pass CI. Add a test that signs in through the session, stubs the GitHub App lookups, and checks that the page renders with every field the POST handler reads, the Security option, and the hooks the CVE toggle script relies on. Also test the two redirects around it: an anonymous request to the form goes home, and a signed-in request to the home page goes to the form. The redirect tests showed that the handlers return HTTPFound instead of raising it, which aiohttp deprecates and which the suite's warnings-as-errors setting turns into a server error. Raise all six redirects instead, which is also what the error middleware expects.
Mariatta
force-pushed
the
test-add-blurb-form
branch
from
October 22, 2026 00:50
61ee440 to
2faa118
Compare
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.
No test requested
GET /add_blurb, so a template error or a broken inline script in the form would pass CI. That nearly happened while rebasing #475: a conflict resolution truncated the CVE toggle script, and only a manual check caught it.This adds a test that signs in through the session, stubs the GitHub App lookups, and checks that the page renders with every field the POST handler reads, the Security option, and the ids the CVE toggle script relies on. Two more tests cover the redirects around it: an anonymous request to the form goes home, and a signed-in request to the home page goes to the form.
The redirect test showed that the handlers
return web.HTTPFound(...)instead of raising it. aiohttp deprecates returning exception objects, and the suite's warnings-as-errors setting turned that into a server error in the test. All six redirects now raise, which is also whaterror_middlewaredocuments as the expected path. Behaviour for users is unchanged.Coverage of
blurb_it/__main__.pygoes from 34% to 46%.