Skip to content

fix: [tests] Drop assertions on removed is_admin/is_commenter user flags - #96

Merged
cedricbonhomme merged 1 commit into
mainfrom
fix-rbac-user-model-tests
Jul 22, 2026
Merged

fix: [tests] Drop assertions on removed is_admin/is_commenter user flags#96
cedricbonhomme merged 1 commit into
mainfrom
fix-rbac-user-model-tests

Conversation

@cedricbonhomme

Copy link
Copy Markdown
Member

Summary

The Vulnerability-Lookup RBAC migration (vulnerability-lookup#497) removed the is_admin, is_commenter, and is_reporter boolean flags from the user model and from API responses — user rights are now expressed as roles. Three test_web.py assertions still read those keys and fail against an instance running the new model.

Changes

  • test_list_users: drop assertTrue(user['is_admin']). The user-list endpoint now marshals with a light model that exposes only login, so the admin is located by login alone.
  • test_create_user_comment: drop the two is_commenter assertions 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 (uid remains used for cleanup at the end of the test).

Notes

  • The client library itself (pyvulnerabilitylookup/api.py) never referenced these flags, so no library changes are needed — only the tests.
  • A third failure sometimes seen in the same run (test_comments_local, KeyError: 'data' on create_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 returns data on success. Not touched here.

🤖 Generated with Claude Code

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>
@cedricbonhomme
cedricbonhomme merged commit 899900b into main Jul 22, 2026
10 checks passed
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.

1 participant