[test/possible views] skip deprecated views
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 12 Oct 2010 14:13:07 +0200
changeset 6454 97203d0af4cb
parent 6453 7fdd780d87e4
child 6455 3282742dd4c6
[test/possible views] skip deprecated views
cwvreg.py
devtools/testlib.py
--- a/cwvreg.py	Tue Oct 12 14:10:58 2010 +0200
+++ b/cwvreg.py	Tue Oct 12 14:13:07 2010 +0200
@@ -196,7 +196,7 @@
 from warnings import warn
 
 from logilab.common.decorators import cached, clear_cache
-from logilab.common.deprecation import  deprecated
+from logilab.common.deprecation import deprecated, class_deprecated
 from logilab.common.modutils import cleanup_sys_modules
 
 from rql import RQLHelper
@@ -389,6 +389,8 @@
         for vid, views in self.items():
             if vid[0] == '_':
                 continue
+            views = [view for view in views
+                     if not isinstance(view, class_deprecated)]
             try:
                 view = self._select_best(views, req, rset=rset, **kwargs)
                 if view.linkable():
--- a/devtools/testlib.py	Tue Oct 12 14:10:58 2010 +0200
+++ b/devtools/testlib.py	Tue Oct 12 14:13:07 2010 +0200
@@ -37,7 +37,7 @@
 from logilab.common.debugger import Debugger
 from logilab.common.umessage import message_from_string
 from logilab.common.decorators import cached, classproperty, clear_cache
-from logilab.common.deprecation import deprecated
+from logilab.common.deprecation import deprecated, class_deprecated
 
 from cubicweb import ValidationError, NoSelectableObject, AuthenticationError
 from cubicweb import cwconfig, devtools, web, server
@@ -495,7 +495,8 @@
                 continue
             views = [view for view in views
                      if view.category != 'startupview'
-                     and not issubclass(view, notification.NotificationView)]
+                     and not issubclass(view, notification.NotificationView)
+                     and not isinstance(view, class_deprecated)]
             if views:
                 try:
                     view = viewsvreg._select_best(views, req, rset=rset)