Пример #1
0
    def test_date_fields(self):
        widget = VariegatedFieldsWidget.add_root(widgy_site)
        form_class = widget.get_form_class(request=None)()

        self.assertIsInstance(form_class.fields['date'].widget, DateWidget)
        self.assertIsInstance(form_class.fields['time'].widget, TimeWidget)
        self.assertIsInstance(form_class.fields['datetime'].widget, DateTimeWidget)
Пример #2
0
    def test_date_fields(self):
        widget = VariegatedFieldsWidget.add_root(widgy_site)
        form_class = widget.get_form_class(request=None)()

        self.assertIsInstance(form_class.fields['date'].widget, DateWidget)
        self.assertIsInstance(form_class.fields['time'].widget, TimeWidget)
        self.assertIsInstance(form_class.fields['datetime'].widget, DateTimeWidget)
Пример #3
0
 def test_field_with_choices(self):
     widget = VariegatedFieldsWidget.add_root(widgy_site)
     form_class = widget.get_form_class(request=None)()
     self.assertIsInstance(form_class.fields['color'].widget, forms.Select)
Пример #4
0
 def test_field_with_choices(self):
     widget = VariegatedFieldsWidget.add_root(widgy_site)
     form_class = widget.get_form_class(request=None)()
     self.assertIsInstance(form_class.fields['color'].widget, forms.Select)