196 with self.temporary_permissions(EmailAddress={'update': ()}): |
196 with self.temporary_permissions(EmailAddress={'update': ()}): |
197 form = self.vreg['forms'].select('edition', req, entity=req.user) |
197 form = self.vreg['forms'].select('edition', req, entity=req.user) |
198 formviews = list(form.inlined_form_views()) |
198 formviews = list(form.inlined_form_views()) |
199 self.assertEqual(len(formviews), 1, formviews) |
199 self.assertEqual(len(formviews), 1, formviews) |
200 self.assertIsInstance(formviews[0], autoform.InlineAddNewLinkView) |
200 self.assertIsInstance(formviews[0], autoform.InlineAddNewLinkView) |
|
201 # though do not introduce regression on entity creation with 1 cardinality relation |
|
202 with tempattr(use_email_schema, 'cardinality', '11'): |
|
203 user = self.vreg['etypes'].etype_class('CWUser')(req) |
|
204 form = self.vreg['forms'].select('edition', req, entity=user) |
|
205 formviews = list(form.inlined_form_views()) |
|
206 self.assertEqual(len(formviews), 1, formviews) |
|
207 self.assertIsInstance(formviews[0], autoform.InlineEntityCreationFormView) |
201 |
208 |
202 def test_check_inlined_rdef_permissions(self): |
209 def test_check_inlined_rdef_permissions(self): |
203 # try to check permissions when creating an entity ('user' below is a |
210 # try to check permissions when creating an entity ('user' below is a |
204 # fresh entity without an eid) |
211 # fresh entity without an eid) |
205 with self.admin_access.web_request() as req: |
212 with self.admin_access.web_request() as req: |