fix code and tests broken by 4744:13a5d3a7410e (proper permission on eid/has_text/identity relations) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 03 Mar 2010 17:39:22 +0100
branchstable
changeset 4758 0efdcf0fa4c7
parent 4757 5d937aeaa6fb
child 4759 af2e6c377c71
fix code and tests broken by 4744:13a5d3a7410e (proper permission on eid/has_text/identity relations)
server/test/unittest_querier.py
web/test/unittest_views_editforms.py
web/views/autoform.py
--- a/server/test/unittest_querier.py	Tue Mar 02 15:58:39 2010 +0100
+++ b/server/test/unittest_querier.py	Wed Mar 03 17:39:22 2010 +0100
@@ -257,7 +257,7 @@
         result, descr = rset.rows, rset.description
         self.assertEquals(descr[0][0], 'String')
         self.assertEquals(descr[0][1], 'Int')
-        self.assertEquals(result[0][0], 'RQLExpression') # XXX may change as schema evolve
+        self.assertEquals(result[0][0], 'CWRelation') # XXX may change as schema evolve
 
     def test_select_groupby_orderby(self):
         rset = self.execute('Any N GROUPBY N ORDERBY N WHERE X is CWGroup, X name N')
--- a/web/test/unittest_views_editforms.py	Tue Mar 02 15:58:39 2010 +0100
+++ b/web/test/unittest_views_editforms.py	Wed Mar 03 17:39:22 2010 +0100
@@ -43,13 +43,11 @@
                            ('firstname', 'subject'),
                            ('surname', 'subject'),
                            ('in_group', 'subject'),
-                           ('eid', 'subject'),
                            ])
         self.assertListEquals(rbc(e, 'muledit', 'attributes'),
                               [('login', 'subject'),
                                ('upassword', 'subject'),
                                ('in_group', 'subject'),
-                               ('eid', 'subject'),
                                ])
         self.assertListEquals(rbc(e, 'main', 'metadata'),
                               [('last_login_time', 'subject'),
@@ -76,13 +74,10 @@
         # owned_by is defined both as subject and object relations on CWUser
         self.assertListEquals(sorted(x for x in rbc(e, 'main', 'hidden')
                                      if x != ('tags', 'object')),
-                              sorted([('has_text', 'subject'),
-                                      ('identity', 'subject'),
-                                      ('for_user', 'object'),
+                              sorted([('for_user', 'object'),
                                       ('created_by', 'object'),
                                       ('wf_info_for', 'object'),
                                       ('owned_by', 'object'),
-                                      ('identity', 'object'),
                                       ]))
 
     def test_inlined_view(self):
@@ -106,11 +101,9 @@
                                ('test', 'subject'),
                                ('description', 'subject'),
                                ('salary', 'subject'),
-                               ('eid', 'subject')
                                ])
         self.assertListEquals(rbc(e, 'muledit', 'attributes'),
                               [('nom', 'subject'),
-                               ('eid', 'subject')
                                ])
         self.assertListEquals(rbc(e, 'main', 'metadata'),
                               [('creation_date', 'subject'),
@@ -124,10 +117,7 @@
                                ('connait', 'object')
                                ])
         self.assertListEquals(rbc(e, 'main', 'hidden'),
-                              [('has_text', 'subject'),
-                               ('identity', 'subject'),
-                               ('identity', 'object'),
-                               ])
+                              [])
 
     def test_edition_form(self):
         rset = self.execute('CWUser X LIMIT 1')
--- a/web/views/autoform.py	Tue Mar 02 15:58:39 2010 +0100
+++ b/web/views/autoform.py	Wed Mar 03 17:39:22 2010 +0100
@@ -661,7 +661,7 @@
             return []
         # XXX we should simply put eid in the generated section, no?
         return [(rtype, role) for rtype, _, role in self._relations_by_section(
-            'attributes', 'update', strict) if rtype != 'eid']
+            'attributes', 'update', strict)]
 
     def editable_relations(self):
         """return a sorted list of (relation's label, relation'schema, role) for