Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
b767d295
Commit
b767d295
authored
5 years ago
by
Adam Butterworth
Browse files
Options
Downloads
Patches
Plain Diff
Add docstring about overrides
parent
e9e1715b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/experiments/flags.py
+15
-0
15 additions, 0 deletions
lms/djangoapps/experiments/flags.py
with
15 additions
and
0 deletions
lms/djangoapps/experiments/flags.py
+
15
−
0
View file @
b767d295
...
...
@@ -40,6 +40,21 @@ class ExperimentWaffleFlag(CourseWaffleFlag):
Bucket 0 is assumed to be the control bucket.
See a HOWTO here: https://openedx.atlassian.net/wiki/spaces/AC/pages/1250623700/Bucketing+users+for+an+experiment
When writing tests involving an ExperimentWaffleFlag you must not use the
override_waffle_flag utility. That will only turn the experiment on or off and won
'
t
override bucketing. Instead use ExperimentWaffleFlag
'
s override method which
will do both. Example:
with MY_EXPERIMENT_WAFFLE_FLAG.override(active=True, bucket=1):
...
or as a decorator:
@MY_EXPERIMENT_WAFFLE_FLAG.override(active=True, bucket=1)
def test_my_experiment(self):
...
"""
def
__init__
(
self
,
waffle_namespace
,
flag_name
,
num_buckets
=
2
,
experiment_id
=
None
,
**
kwargs
):
super
().
__init__
(
waffle_namespace
,
flag_name
,
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment