Commits

Mark Lavin committed dac22d8

Tests demonstrating problem with passing widget instances rather than widget classes.

Comments (0)

Files changed (1)

selectable/tests/fields.py

         field = self.get_field_instance(widget=widget_cls)
         self.assertTrue(isinstance(field.widget, widget_cls))
 
+    def test_alternate_widget_instance(self):
+        widget = widgets.AutoComboboxWidget(self.lookup_cls)
+        field = self.get_field_instance(widget=widget)
+        self.assertTrue(isinstance(field.widget, widgets.AutoComboboxWidget))
+
 
 class AutoComboboxSelectFieldTestCase(BaseFieldTestCase):
     field_cls = fields.AutoComboboxSelectField
         field = self.get_field_instance(widget=widget_cls)
         self.assertTrue(isinstance(field.widget, widget_cls))
 
+    def test_alternate_widget_instance(self):
+        widget = widgets.AutoComboboxSelectMultipleWidget(self.lookup_cls)
+        field = self.get_field_instance(widget=widget)
+        self.assertTrue(isinstance(field.widget, widgets.AutoComboboxSelectMultipleWidget))
+
 
 class AutoComboboxSelectMultipleFieldTestCase(BaseFieldTestCase):
     field_cls = fields.AutoComboboxSelectMultipleField