Skip to content

convert all permission string literals in tests to permission constant - #25226

Merged
eviljeff merged 1 commit into
mozilla:masterfrom
eviljeff:00000-permission-constants-in-tests
Aug 11, 2026
Merged

convert all permission string literals in tests to permission constant#25226
eviljeff merged 1 commit into
mozilla:masterfrom
eviljeff:00000-permission-constants-in-tests

Conversation

@eviljeff

@eviljeff eviljeff commented Aug 3, 2026

Copy link
Copy Markdown
Member

Follow-on from mozilla/addons#16318

Description

Finishes what I started in mozilla/addons#16318 - to use AclPermission constants in grant_permission calls.

Context

I made the changes to grant_permission; then Claude did the grunt work of converting all the hundreds of references in tests. I've read through them and they seem correct - in almost all test cases the tests would fail if the permissions were wrong anyway.

Testing

n/a - no live code changes.

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@eviljeff
eviljeff force-pushed the 00000-permission-constants-in-tests branch 3 times, most recently from 85bf3f6 to b10cd2e Compare August 7, 2026 16:40
@eviljeff
eviljeff force-pushed the 00000-permission-constants-in-tests branch from b10cd2e to cc9120f Compare August 7, 2026 17:34
@eviljeff
eviljeff marked this pull request as ready for review August 10, 2026 14:11
@eviljeff
eviljeff requested review from a team and chrstinalin and removed request for a team August 11, 2026 09:14

@chrstinalin chrstinalin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to tests, but FYI in src/olympia/abuse/actions.py#312 still uses that join pattern

groups_qs = Group.objects.filter(
            rules__icontains=':'.join(ADDONS_HIGH_IMPACT_APPROVE)
        )

@eviljeff

Copy link
Copy Markdown
Member Author

Not related to tests, but FYI in src/olympia/abuse/actions.py#312 still uses that join pattern

groups_qs = Group.objects.filter(
            rules__icontains=':'.join(ADDONS_HIGH_IMPACT_APPROVE)
        )

hah, good find. It'll still work (AclPermission remains a tuple) but yeah it can be rules__icontains=str(ADDONS_HIGH_IMPACT_APPROVE) now, or just rules__icontains=ADDONS_HIGH_IMPACT_APPROVE might work, depending on if .filter will convert arg values to str by default.

@eviljeff
eviljeff merged commit e4b3536 into mozilla:master Aug 11, 2026
89 of 90 checks passed
@eviljeff eviljeff mentioned this pull request Aug 11, 2026
5 tasks
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