--- a/web/form.py Mon May 18 14:22:26 2009 +0200
+++ b/web/form.py Mon May 18 14:36:09 2009 +0200
@@ -372,6 +372,8 @@
return self.form_previous_values[qname]
if qname in self.req.form:
return self.req.form[qname]
+ if field.name in self.req.form:
+ return self.req.form[field.name]
return None
def form_field_value(self, field, load_bytes=False):
--- a/web/test/unittest_form.py Mon May 18 14:22:26 2009 +0200
+++ b/web/test/unittest_form.py Mon May 18 14:36:09 2009 +0200
@@ -64,7 +64,14 @@
self.assertEquals(len(states), 1)
self.assertEquals(states[0][0], u'deactivated') # list of (combobox view, state eid)
-
+ def test_consider_req_form_params(self):
+ e = self.etype_instance('CWUser')
+ e.eid = 'A'
+ form = EntityFieldsForm(self.request(login=u'toto'), None, entity=e)
+ field = StringField(name='login', eidparam=True)
+ form.append_field(field)
+ form.form_build_context({})
+ self.assertEquals(form.form_field_display_value(field, {}), 'toto')
# form view tests #########################################################