本文整理匯總了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))