adamchainz / gargoyle

:radio_button: Feature switches in Django
Apache License 2.0
109 stars 19 forks source link

Add Today-based ConditionSets #104

Closed nkovshov closed 7 years ago

nkovshov commented 7 years ago

I've added NowConditionSet which can be used to check conditions against a current date. Probably it's better to create separate issue for missed documentation on conditions.

For #36 .

nkovshov commented 7 years ago

I've found that there are few missing test cases for settings.USE_TZ = None or empty active timezone, I'll add them, but exist set of tests lets check needed logic.

nkovshov commented 7 years ago

Adam, maybe we should just test get_field_value method on this ConditionSet's? We already have tests on OnOrAfterDate and BeforeDate conditions in other tests and my tests on ConditionSet's looks too complicated. What are your thoughts?

adamchainz commented 7 years ago

Yeah that sounds sensible

nkovshov commented 7 years ago

@adamchainz, please, review last changes

nkovshov commented 7 years ago

@adamchainz I've made requested changes

adamchainz commented 7 years ago

One thing I've only just realized is that of course we're only dealing with 'today' instead of 'now', that is, dates rather than datetimes. I think that since this PR is going to be useful as-is, I'm going to merge it but with name changes to represent that it's 'today' rather than 'now'.

adamchainz commented 7 years ago

Merged in 465407b1cb74309219d5204b5086d2f0dca6d6a7, thanks!

adamchainz commented 7 years ago

Released on PyPI as 1.2.7 🎉