Exemple #1
0
 def test_max_length_passed_to_formfield(self):
     """
     Test that CronField pass its max_length attributes to
     form fields created using its .formfield() method.
     """
     cf1 = CronField()
     cf2 = CronField(max_length=256)
     self.assertEqual(cf1.formfield().max_length, 120)
     self.assertEqual(cf2.formfield().max_length, 256)
 def test_max_length_passed_to_formfield(self):
     """
     Test that CronField pass its max_length attributes to
     form fields created using its .formfield() method.
     """
     cf1 = CronField()
     cf2 = CronField(max_length=256)
     self.assertEqual(cf1.formfield().max_length, 120)
     self.assertEqual(cf2.formfield().max_length, 256)
Exemple #3
0
 def test_widget_passed_to_formfield(self):
     f = CronField()
     self.assertEqual(f.formfield().widget.__class__, CronWidget)
 def test_widget_passed_to_formfield(self):
     f = CronField()
     self.assertEqual(f.formfield().widget.__class__, CronWidget)