web/test/unittest_views_basecontrollers.py
changeset 9439 549c999d06d2
parent 9273 f3795da61959
child 9478 2d7521881d3d
--- a/web/test/unittest_views_basecontrollers.py	Tue Jan 21 12:34:14 2014 +0100
+++ b/web/test/unittest_views_basecontrollers.py	Wed Sep 11 18:04:05 2013 +0200
@@ -221,6 +221,21 @@
         # created before.
         self.assertGreater(salesterm.eid, salesterm.described_by_test[0].eid)
 
+    def test_edit_mandatory_inlined3_object(self):
+        # non regression test for #3120495. Without the fix, leads to
+        # "unhashable type: 'list'" error
+        req = self.request()
+        cwrelation = u(req.execute('CWEType X WHERE X name "CWSource"')[0][0])
+        req.form = {'eid': [cwrelation], '__maineid' : cwrelation,
+
+                    '__type:'+cwrelation: 'CWEType',
+                    '_cw_entity_fields:'+cwrelation: 'to_entity-object',
+                    'to_entity-object:'+cwrelation: [9999, 9998],
+                    }
+        with self.session.deny_all_hooks_but():
+            path, params = self.expect_redirect_handle_request(req, 'edit')
+        self.assertTrue(path.startswith('cwetype/CWSource'), path)
+
     def test_edit_multiple_linked(self):
         req = self.request()
         peid = u(self.create_user(req, 'adim').eid)