diff --git a/ipalib/parameters.py b/ipalib/parameters.py index 612ec3297..589a092bf 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -1525,6 +1525,8 @@ class AccessTime(Str): index = self._check_Y_spec(ts, 2) elif ts[1] == 'monthly': index = self._check_M_spec(ts, 2) + elif ts[1] == 'weekly': + index = self._check_W_spec(ts, 2) elif ts[1] == 'daily': index = 1 if index is None: diff --git a/tests/test_ipalib/test_parameters.py b/tests/test_ipalib/test_parameters.py index e14538c50..84d735308 100644 --- a/tests/test_ipalib/test_parameters.py +++ b/tests/test_ipalib/test_parameters.py @@ -1372,19 +1372,18 @@ class test_AccessTime(ClassChecker): for value in (u'absolute 201012161032 ~ 201012161033', u'periodic monthly week 2 day Sat,Sun 0900-1300', u'periodic yearly month 4 day 1-31 0800-1400', + u'periodic weekly day 7 0800-1400', u'periodic daily 0800-1400', ): assert rule(dummy, value) is None assert dummy.called() is False - # FIXME, weekly is not implemented in AccessTime -# u'periodic weekly day 8 0800-1400', - # And some bad ones for value in (u'absolute 201012161032 - 201012161033', u'absolute 201012161032 ~', u'periodic monthly day Sat,Sun 0900-1300', u'periodical yearly month 4 day 1-31 0800-1400', + u'periodic weekly day 8 0800-1400', ): e = raises(ValidationError, o._rule_required, None, value)