コード例 #1
0
 def test_period_names_2(self):
     field = DatePeriodField()
     field.period_names = names = (MinutesPeriod.name, HoursPeriod.name)
     self.assertListEqual(
         [*date_period_registry.choices(choices=names)],
         [*field.choices],
     )
コード例 #2
0
 def test_choices02(self):
     "Global registry"
     choices = list(date_period_registry.choices())
     self.assertEqual(len(choices), 6)
コード例 #3
0
ファイル: test_date_period.py プロジェクト: mrjmad/creme_crm
 def test_choices02(self):
     "Global registry."
     choices = [*date_period_registry.choices()]
     self.assertEqual(len(choices), 6)
コード例 #4
0
 def test_period_names_2(self):
     field = DatePeriodField()
     field.period_names = names = (MinutesPeriod.name, HoursPeriod.name)
     self.assertEqual(list(date_period_registry.choices(choices=names)),
                      list(field.choices))
コード例 #5
0
 def test_period_names_1(self):
     names = (MinutesPeriod.name, HoursPeriod.name)
     self.assertEqual(list(date_period_registry.choices(choices=names)),
                      list(DatePeriodField(period_names=names).choices))
コード例 #6
0
 def test_registry_1(self):
     self.assertEqual(list(date_period_registry.choices()),
                      list(DatePeriodField().choices))
コード例 #7
0
 def test_registry_1(self):
     self.assertListEqual([*date_period_registry.choices()],
                          [*DatePeriodField().choices]
                         )
コード例 #8
0
 def test_period_names_1(self):
     names = (MinutesPeriod.name, HoursPeriod.name)
     self.assertListEqual(
         [*date_period_registry.choices(choices=names)],
         [*DatePeriodField(period_names=names).choices],
     )