[we, test] more api update
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 03 Aug 2009 16:50:22 +0200
changeset 2664 1578e1a57828
parent 2663 2bb628e0cc3b
child 2665 0c6281487f90
[we, test] more api update
web/test/unittest_views_navigation.py
web/views/massmailing.py
web/views/urlpublishing.py
--- a/web/test/unittest_views_navigation.py	Mon Aug 03 16:33:27 2009 +0200
+++ b/web/test/unittest_views_navigation.py	Mon Aug 03 16:50:22 2009 +0200
@@ -77,12 +77,12 @@
         view = mock_object(is_primary=lambda x: True)
         rset = self.execute('CWUser X LIMIT 1')
         req = self.request()
-        objs = self.vreg.possible_vobjects('contentnavigation', req, rset=rset,
+        objs = self.vreg['contentnavigation'].possible_vobjects(req, rset=rset,
                                            view=view, context='navtop')
         # breadcrumbs should be in headers by default
         clsids = set(obj.id for obj in objs)
         self.failUnless('breadcrumbs' in clsids)
-        objs = self.vreg.possible_vobjects('contentnavigation', req, rset=rset,
+        objs = self.vreg['contentnavigation'].possible_vobjects(req, rset=rset,
                                           view=view, context='navbottom')
         # breadcrumbs should _NOT_ be in footers by default
         clsids = set(obj.id for obj in objs)
@@ -91,12 +91,12 @@
                      'P value "navbottom"')
         # breadcrumbs should now be in footers
         req.cnx.commit()
-        objs = self.vreg.possible_vobjects('contentnavigation', req, rset=rset,
+        objs = self.vreg['contentnavigation'].possible_vobjects(req, rset=rset,
                                           view=view, context='navbottom')
 
         clsids = [obj.id for obj in objs]
         self.failUnless('breadcrumbs' in clsids)
-        objs = self.vreg.possible_vobjects('contentnavigation', req, rset=rset,
+        objs = self.vreg['contentnavigation'].possible_vobjects(req, rset=rset,
                                           view=view, context='navtop')
 
         clsids = [obj.id for obj in objs]
--- a/web/views/massmailing.py	Mon Aug 03 16:33:27 2009 +0200
+++ b/web/views/massmailing.py	Mon Aug 03 16:50:22 2009 +0200
@@ -68,7 +68,7 @@
     def get_allowed_substitutions(self):
         attrs = []
         for coltype in self.rset.column_types(0):
-            eclass = self.vreg.etype_class(coltype)
+            eclass = self.vreg['etypes'].etype_class(coltype)
             attrs.append(eclass.allowed_massmail_keys())
         return sorted(reduce(operator.and_, attrs))
 
--- a/web/views/urlpublishing.py	Mon Aug 03 16:33:27 2009 +0200
+++ b/web/views/urlpublishing.py	Mon Aug 03 16:50:22 2009 +0200
@@ -151,7 +151,7 @@
             etype = self.vreg.case_insensitive_etypes[parts.pop(0).lower()]
         except KeyError:
             raise PathDontMatch()
-        cls = self.vreg.etype_class(etype)
+        cls = self.vreg['etypes'].etype_class(etype)
         if parts:
             if len(parts) == 2:
                 attrname = parts.pop(0).lower()