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], )
def test_choices02(self): "Global registry" choices = list(date_period_registry.choices()) self.assertEqual(len(choices), 6)
def test_choices02(self): "Global registry." choices = [*date_period_registry.choices()] self.assertEqual(len(choices), 6)
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))
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))
def test_registry_1(self): self.assertEqual(list(date_period_registry.choices()), list(DatePeriodField().choices))
def test_registry_1(self): self.assertListEqual([*date_period_registry.choices()], [*DatePeriodField().choices] )
def test_period_names_1(self): names = (MinutesPeriod.name, HoursPeriod.name) self.assertListEqual( [*date_period_registry.choices(choices=names)], [*DatePeriodField(period_names=names).choices], )