# HG changeset patch # User Sylvain Thénault # Date 1276188243 -7200 # Node ID a39ecb0e6d9965053b1d4dc5508e4bf6823f95fe # Parent 2ae478c47089fca41669a98738f1dec4050463d1 [test] fix test broken by 5721:61d6a4caa963, and update it to proper adapters to avoid deprecation warning diff -r 2ae478c47089 -r a39ecb0e6d99 test/unittest_vregistry.py --- a/test/unittest_vregistry.py Thu Jun 10 18:32:09 2010 +0200 +++ b/test/unittest_vregistry.py Thu Jun 10 18:44:03 2010 +0200 @@ -15,9 +15,7 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -""" -""" from logilab.common.testlib import unittest_main, TestCase from os.path import join @@ -27,7 +25,7 @@ from cubicweb.cwvreg import CubicWebVRegistry, UnknownProperty from cubicweb.devtools import TestServerConfiguration from cubicweb.devtools.testlib import CubicWebTC -from cubicweb.interfaces import IMileStone +from cubicweb.view import EntityAdapter from cubes.card.entities import Card @@ -61,14 +59,15 @@ self.failIf(self.vreg['views'].get('progressbar')) # we've to emulate register_objects to add custom MyCard objects path = [join(BASE, 'entities', '__init__.py'), + join(BASE, 'entities', 'adapters.py'), join(BASE, 'web', 'views', 'iprogress.py')] filemods = self.vreg.init_registration(path, None) for filepath, modname in filemods: self.vreg.load_file(filepath, modname) - class MyCard(Card): - __implements__ = (IMileStone,) + class CardIProgressAdapter(EntityAdapter): + __regid__ = 'IProgress' self.vreg._loadedmods[__name__] = {} - self.vreg.register(MyCard) + self.vreg.register(CardIProgressAdapter) self.vreg.initialization_completed() # check progressbar isn't kicked self.assertEquals(len(self.vreg['views']['progressbar']), 1)