218 # will fail. |
218 # will fail. |
219 # NOTE: sqlite does have NOT NULL constraint, unlike Postgres so the |
219 # NOTE: sqlite does have NOT NULL constraint, unlike Postgres so the |
220 # insertion does not fail and we have to check dumbly that File is |
220 # insertion does not fail and we have to check dumbly that File is |
221 # created before. |
221 # created before. |
222 self.assertGreater(salesterm.eid, salesterm.described_by_test[0].eid) |
222 self.assertGreater(salesterm.eid, salesterm.described_by_test[0].eid) |
|
223 |
|
224 def test_edit_mandatory_inlined3_object(self): |
|
225 # non regression test for #3120495. Without the fix, leads to |
|
226 # "unhashable type: 'list'" error |
|
227 req = self.request() |
|
228 cwrelation = u(req.execute('CWEType X WHERE X name "CWSource"')[0][0]) |
|
229 req.form = {'eid': [cwrelation], '__maineid' : cwrelation, |
|
230 |
|
231 '__type:'+cwrelation: 'CWEType', |
|
232 '_cw_entity_fields:'+cwrelation: 'to_entity-object', |
|
233 'to_entity-object:'+cwrelation: [9999, 9998], |
|
234 } |
|
235 with self.session.deny_all_hooks_but(): |
|
236 path, params = self.expect_redirect_handle_request(req, 'edit') |
|
237 self.assertTrue(path.startswith('cwetype/CWSource'), path) |
223 |
238 |
224 def test_edit_multiple_linked(self): |
239 def test_edit_multiple_linked(self): |
225 req = self.request() |
240 req = self.request() |
226 peid = u(self.create_user(req, 'adim').eid) |
241 peid = u(self.create_user(req, 'adim').eid) |
227 req.form = {'eid': [peid, 'Y'], '__maineid': peid, |
242 req.form = {'eid': [peid, 'Y'], '__maineid': peid, |