web/test/unittest_form.py
branchstable
changeset 1843 646c2dd1f03e
parent 1793 fdac26e003e7
child 1947 8696403e5324
equal deleted inserted replaced
1842:c7a22540d6f7 1843:646c2dd1f03e
    62         form = EntityFieldsForm(self.request(), None, entity=e)
    62         form = EntityFieldsForm(self.request(), None, entity=e)
    63         states = list(form.subject_in_state_vocabulary('in_state'))
    63         states = list(form.subject_in_state_vocabulary('in_state'))
    64         self.assertEquals(len(states), 1)
    64         self.assertEquals(len(states), 1)
    65         self.assertEquals(states[0][0], u'deactivated') # list of (combobox view, state eid)
    65         self.assertEquals(states[0][0], u'deactivated') # list of (combobox view, state eid)
    66 
    66 
    67 
    67     def test_consider_req_form_params(self):
       
    68         e = self.etype_instance('CWUser')
       
    69         e.eid = 'A'
       
    70         form = EntityFieldsForm(self.request(login=u'toto'), None, entity=e)
       
    71         field = StringField(name='login', eidparam=True)
       
    72         form.append_field(field)
       
    73         form.form_build_context({})
       
    74         self.assertEquals(form.form_field_display_value(field, {}), 'toto')
    68 
    75 
    69     # form view tests #########################################################
    76     # form view tests #########################################################
    70 
    77 
    71     def test_massmailing_formview(self):
    78     def test_massmailing_formview(self):
    72         self.execute('INSERT EmailAddress X: X address L + "@cubicweb.org", '
    79         self.execute('INSERT EmailAddress X: X address L + "@cubicweb.org", '