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", ' |