forked from CenterForOpenScience/SHARE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support filtering across multiple propertypaths
breaking change behind a feature flag (for paths in query params) - use `.` (period) to delimit path-steps, e.g. `creator.affiliation` - use `,` (comma) to delimit multiple paths, e.g. `creator.affiliation,contributor.affiliation`
- Loading branch information
Showing
6 changed files
with
218 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from unittest import mock | ||
|
||
|
||
def patch_feature_flag(*flag_names, up=True): | ||
from share.models.feature_flag import FeatureFlag | ||
_old_isup = FeatureFlag.objects.flag_is_up | ||
|
||
def _patched_isup(flag_name): | ||
if flag_name in flag_names: | ||
return up | ||
return _old_isup(flag_name) | ||
return mock.patch.object(FeatureFlag.objects, 'flag_is_up', new=_patched_isup) |
Oops, something went wrong.