Restore broken unit tests

This commit is contained in:
Raphael Michel
2015-01-11 11:07:58 +01:00
parent 415be79ff6
commit 2ede2c657c
3 changed files with 19 additions and 66 deletions

View File

@@ -178,9 +178,10 @@ In our example, the implementation could look like this::
for restriction in restrictions:
applied_to = list(restriction.variations.all())
# Only take this restriction into consideration if it either
# is directly applied to this variation
if 'variation' not in v or v['variation'] not in applied_to:
# Only take this restriction into consideration if it
# is directly applied to this variation or if the item
# has no variations
if len(v) != 0 and ('variation' not in v or v['variation'] not in applied_to):
continue
if restriction.timeframe_from <= now() <= restriction.timeframe_to: