本文整理汇总了Python中corehq.apps.app_manager.models.CustomMonthFilter类的典型用法代码示例。如果您正苦于以下问题:Python CustomMonthFilter类的具体用法?Python CustomMonthFilter怎么用?Python CustomMonthFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CustomMonthFilter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_may15_minus10_period1
def test_may15_minus10_period1(self):
with patch_today(*MAY_15):
filter_ = CustomMonthFilter(start_of_month=-10, period=1)
date_span = filter_.get_filter_value(user=None, ui_filter=None)
self.assertEqual(date_span.startdate, self.date_class(year=2015, month=3, day=21))
self.assertEqual(date_span.enddate, self.date_class(year=2015, month=4, day=20))
示例2: test_may20_period2
def test_may20_period2(self):
with patch_today(*MAY_20):
filter_ = CustomMonthFilter(start_of_month=21, period=2)
date_span = filter_.get_filter_value(user=None, ui_filter=None)
self.assertEqual(date_span.startdate, self.date_class(year=2015, month=2, day=21))
self.assertEqual(date_span.enddate, self.date_class(year=2015, month=3, day=20))
示例3: test_may21_period0
def test_may21_period0(self):
with patch_today(*MAY_21):
filter_ = CustomMonthFilter(start_of_month=21, period=0)
date_span = filter_.get_filter_value(user=None, ui_filter=None)
self.assertEqual(date_span.startdate, self.date_class(*MAY_21))
self.assertEqual(date_span.enddate, self.date_class(*MAY_21))