web/test/unittest_views_editforms.py
changeset 10301 729f36a1bcfa
parent 10243 60789eabc3b7
parent 10229 512ba8f37bd4
child 10411 4ee15441f2eb
equal deleted inserted replaced
10276:ffb269e60348 10301:729f36a1bcfa
   145             rset = req.execute('CWUser X LIMIT 1')
   145             rset = req.execute('CWUser X LIMIT 1')
   146             form = self.vreg['forms'].select('edition', req, rset=rset, row=0, col=0)
   146             form = self.vreg['forms'].select('edition', req, rset=rset, row=0, col=0)
   147             # should be also selectable by specifying entity
   147             # should be also selectable by specifying entity
   148             self.vreg['forms'].select('edition', req, entity=rset.get_entity(0, 0))
   148             self.vreg['forms'].select('edition', req, entity=rset.get_entity(0, 0))
   149             self.assertFalse(any(f for f in form.fields if f is None))
   149             self.assertFalse(any(f for f in form.fields if f is None))
       
   150 
       
   151     def test_edition_form_with_action(self):
       
   152         with self.admin_access.web_request() as req:
       
   153             rset = req.execute('CWUser X LIMIT 1')
       
   154             form = self.vreg['forms'].select('edition', req, rset=rset, row=0,
       
   155                                              col=0, action='my_custom_action')
       
   156             self.assertEqual(form.form_action(), 'my_custom_action')
   150 
   157 
   151     def test_attribute_add_permissions(self):
   158     def test_attribute_add_permissions(self):
   152         # https://www.cubicweb.org/ticket/4342844
   159         # https://www.cubicweb.org/ticket/4342844
   153         with self.admin_access.repo_cnx() as cnx:
   160         with self.admin_access.repo_cnx() as cnx:
   154             self.create_user(cnx, u'toto')
   161             self.create_user(cnx, u'toto')