def test_widget_layout(self): widget = WidgetFactory.create() field1 = FieldFactory.create(widget=widget) field2 = FieldFactory.create(widget=widget, form=field1.form) layout = field1.form.get_layout() assert_equal(len(layout), 1) assert_true(isinstance(layout[0], Div)) assert_equal(layout[0].css_class, widget.widget_type) assert_true(field1.key in layout[0].fields) assert_true(field2.key in layout[0].fields)
def test_no_slug_provided(self): field = FieldFactory.create(name='hello', key='') assert_equal(field.key, 'hello')