fix: [tests] Drop assertions on removed is_admin/is_commenter user flags - #96
Merged
Conversation
The vulnerability-lookup RBAC migration removed the is_admin, is_commenter, and is_reporter boolean flags from the user model and the API responses. Three test_web.py assertions still read those keys and failed against an instance running the new model: - test_list_users read user['is_admin'] (the user-list endpoint now exposes only 'login'); - test_create_user_comment read user['is_commenter'] from the create- user response, which no longer carries the flags. The tests keep their meaning: the admin user is still located by login, and a user and comment are still created (uid remains used for cleanup). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
The Vulnerability-Lookup RBAC migration (vulnerability-lookup#497) removed the
is_admin,is_commenter, andis_reporterboolean flags from the user model and from API responses — user rights are now expressed as roles. Threetest_web.pyassertions still read those keys and fail against an instance running the new model.Changes
test_list_users: dropassertTrue(user['is_admin']). The user-list endpoint now marshals with a light model that exposes onlylogin, so the admin is located by login alone.test_create_user_comment: drop the twois_commenterassertions on the create-user response, which no longer carries the flags.Both tests keep their intent — the admin is still found in the admin-only listing, and a user plus comment are still created (
uidremains used for cleanup at the end of the test).Notes
pyvulnerabilitylookup/api.py) never referenced these flags, so no library changes are needed — only the tests.test_comments_local,KeyError: 'data'oncreate_comment) is environmental, not a contract change: it coincides with the sample instance's Kvrocks being unreachable during that run (reads succeed, the write does not), and the comment endpoint still returnsdataon success. Not touched here.🤖 Generated with Claude Code