194 req = self.request() |
194 req = self.request() |
195 user = self.user() |
195 user = self.user() |
196 eid = unicode(user.eid) |
196 eid = unicode(user.eid) |
197 req.form = { |
197 req.form = { |
198 'eid': eid, |
198 'eid': eid, |
199 '__type:'+eid: 'CWUser', '_cw_edited_fields:'+eid: 'login-subject', |
199 '__type:'+eid: 'CWUser', '_cw_entity_fields:'+eid: 'login-subject', |
200 'login-subject:'+eid: '', # ERROR: no login specified |
200 'login-subject:'+eid: '', # ERROR: no login specified |
201 # just a sample, missing some necessary information for real life |
201 # just a sample, missing some necessary information for real life |
202 '__errorurl': 'view?vid=edition...' |
202 '__errorurl': 'view?vid=edition...' |
203 } |
203 } |
204 path, params = self.expect_redirect(lambda x: self.app_publish(x, 'edit'), req) |
204 path, params = self.expect_redirect(lambda x: self.app_publish(x, 'edit'), req) |
219 error occurs on the web controller |
219 error occurs on the web controller |
220 """ |
220 """ |
221 req = self.request() |
221 req = self.request() |
222 # set Y before X to ensure both entities are edited, not only X |
222 # set Y before X to ensure both entities are edited, not only X |
223 req.form = {'eid': ['Y', 'X'], '__maineid': 'X', |
223 req.form = {'eid': ['Y', 'X'], '__maineid': 'X', |
224 '__type:X': 'CWUser', '_cw_edited_fields:X': 'login-subject', |
224 '__type:X': 'CWUser', '_cw_entity_fields:X': 'login-subject', |
225 # missing required field |
225 # missing required field |
226 'login-subject:X': u'', |
226 'login-subject:X': u'', |
227 # but email address is set |
227 # but email address is set |
228 '__type:Y': 'EmailAddress', '_cw_edited_fields:Y': 'address-subject', |
228 '__type:Y': 'EmailAddress', '_cw_entity_fields:Y': 'address-subject', |
229 'address-subject:Y': u'bougloup@logilab.fr', |
229 'address-subject:Y': u'bougloup@logilab.fr', |
230 'use_email-object:Y': 'X', |
230 'use_email-object:Y': 'X', |
231 # necessary to get validation error handling |
231 # necessary to get validation error handling |
232 '__errorurl': 'view?vid=edition...', |
232 '__errorurl': 'view?vid=edition...', |
233 } |
233 } |
248 error occurs on the repository |
248 error occurs on the repository |
249 """ |
249 """ |
250 req = self.request() |
250 req = self.request() |
251 # set Y before X to ensure both entities are edited, not only X |
251 # set Y before X to ensure both entities are edited, not only X |
252 req.form = {'eid': ['Y', 'X'], '__maineid': 'X', |
252 req.form = {'eid': ['Y', 'X'], '__maineid': 'X', |
253 '__type:X': 'CWUser', '_cw_edited_fields:X': 'login-subject,upassword-subject', |
253 '__type:X': 'CWUser', '_cw_entity_fields:X': 'login-subject,upassword-subject', |
254 # already existent user |
254 # already existent user |
255 'login-subject:X': u'admin', |
255 'login-subject:X': u'admin', |
256 'upassword-subject:X': u'admin', 'upassword-subject-confirm:X': u'admin', |
256 'upassword-subject:X': u'admin', 'upassword-subject-confirm:X': u'admin', |
257 '__type:Y': 'EmailAddress', '_cw_edited_fields:Y': 'address-subject', |
257 '__type:Y': 'EmailAddress', '_cw_entity_fields:Y': 'address-subject', |
258 'address-subject:Y': u'bougloup@logilab.fr', |
258 'address-subject:Y': u'bougloup@logilab.fr', |
259 'use_email-object:Y': 'X', |
259 'use_email-object:Y': 'X', |
260 # necessary to get validation error handling |
260 # necessary to get validation error handling |
261 '__errorurl': 'view?vid=edition...', |
261 '__errorurl': 'view?vid=edition...', |
262 } |
262 } |