def test_actions(self, **kw): form = HTMLForm(loadFromType="type1", app=self.app, view=self.view, request=Request()) form.formUrl = "form/url" form.cssID = u"upload" form.css_class = u"niveform" # create form.actions = [ Conf( **{ "id": "default", "method": "StartForm", "name": "Initialize", "hidden": True, "description": "", "css_class": "", "html": "", "tag": "" }), Conf( **{ "id": "create", "method": "CreateObj", "name": "Create", "hidden": False, "description": "", "css_class": "", "html": "", "tag": "" }), Conf( **{ "id": "cancel", "method": "Cancel", "name": "Cancel", "hidden": False, "description": "", "css_class": "", "html": "", "tag": "" }) ] form.Setup() a = form.GetActions(removeHidden=False) self.assert_(len(a) == 3) a = form.GetActions(removeHidden=True) self.assert_(len(a) == 2)
def test_actions(self, **kw): form = HTMLForm(loadFromType="type1", app=self.app, view=self.view, request=Request()) form.formUrl = "form/url" form.cssID = u"upload" form.css_class = u"niveform" # create form.actions = [ Conf( **{ "id": "default", "method": "StartForm", "name": "Initialize", "hidden": True, "description": "", "css_class": "", "html": "", "tag": "", } ), Conf( **{ "id": "create", "method": "CreateObj", "name": "Create", "hidden": False, "description": "", "css_class": "", "html": "", "tag": "", } ), Conf( **{ "id": "cancel", "method": "Cancel", "name": "Cancel", "hidden": False, "description": "", "css_class": "", "html": "", "tag": "", } ), ] form.Setup() a = form.GetActions(removeHidden=False) self.assert_(len(a) == 3) a = form.GetActions(removeHidden=True) self.assert_(len(a) == 2)