Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test util needed to enable flag for specific user instead of all users #439

Open
alanhamlett opened this issue May 3, 2022 · 1 comment

Comments

@alanhamlett
Copy link

In automated tests, to correctly test features sometimes a flag needs to be enabled for one user but not enabled for another user. The current test helper override_flag is can only mock on for all users or off for all users.

@clintonb
Copy link
Collaborator

clintonb commented May 3, 2022

Feel free to submit a pull request adding this functionality.

adamantike added a commit to adamantike/django-waffle that referenced this issue Dec 2, 2022
Up until now, the `override_flag` test util was only useful to
completely activate or deactivate a flag. It didn't allow to provide
more customization for all the internal checks it makes, like evaluating
if the request user is authenticated or staff.

This change provides that functionality, without breaking the current
API, to avoid breaking changes. Now, users can provide more granular
arguments to `override_flag`, for a more flexible flag testing.

Closes jazzband#439.
adamantike added a commit to adamantike/django-waffle that referenced this issue Dec 2, 2022
Up until now, the `override_flag` test util was only useful to
completely activate or deactivate a flag. It didn't allow to provide
more customization for all the internal checks it makes, like evaluating
if the request user is authenticated or staff.

This change provides that functionality, without breaking the current
API, to avoid breaking changes. Now, users can provide more granular
arguments to `override_flag`, for a more flexible flag testing.

Closes jazzband#439.
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 a pull request may close this issue.

2 participants