test/unittest_vregistry.py
branchtls-sprint
changeset 1787 71c143c0ada3
parent 1640 65b60f177eb1
child 1977 606923dff11b
equal deleted inserted replaced
1786:eccd1885d42e 1787:71c143c0ada3
    21     def setUp(self):
    21     def setUp(self):
    22         config = TestServerConfiguration('data')
    22         config = TestServerConfiguration('data')
    23         self.vreg = CubicWebRegistry(config)
    23         self.vreg = CubicWebRegistry(config)
    24         config.bootstrap_cubes()
    24         config.bootstrap_cubes()
    25         self.vreg.schema = config.load_schema()
    25         self.vreg.schema = config.load_schema()
    26 
       
    27     def test_load(self):
       
    28         self.vreg.init_registration([WEBVIEWSDIR])
       
    29         self.vreg.load_file(join(WEBVIEWSDIR, 'cwuser.py'), 'cubicweb.web.views.cwuser')
       
    30         self.vreg.load_file(join(WEBVIEWSDIR, 'baseviews.py'), 'cubicweb.web.views.baseviews')
       
    31         fpvc = [v for v in self.vreg.registry_objects('views', 'primary')
       
    32                if v.__module__ == 'cubicweb.web.views.cwuser'][0]
       
    33         fpv = fpvc(None, None)
       
    34         # don't want a TypeError due to super call
       
    35         self.assertRaises(AttributeError, fpv.render_entity_attributes, None, None)
       
    36 
    26 
    37     def test_load_interface_based_vojects(self):
    27     def test_load_interface_based_vojects(self):
    38         self.vreg.init_registration([WEBVIEWSDIR])
    28         self.vreg.init_registration([WEBVIEWSDIR])
    39         self.vreg.load_file(join(BASE, 'entities', '__init__.py'), 'cubicweb.entities.__init__')
    29         self.vreg.load_file(join(BASE, 'entities', '__init__.py'), 'cubicweb.entities.__init__')
    40         self.vreg.load_file(join(WEBVIEWSDIR, 'idownloadable.py'), 'cubicweb.web.views.idownloadable')
    30         self.vreg.load_file(join(WEBVIEWSDIR, 'idownloadable.py'), 'cubicweb.web.views.idownloadable')