web/test/unittest_viewselector.py
changeset 2643 9976f511003b
parent 2458 4d114865098f
child 2650 18aec79ec3a3
--- a/web/test/unittest_viewselector.py	Sun Aug 02 11:54:02 2009 +0200
+++ b/web/test/unittest_viewselector.py	Sun Aug 02 11:54:48 2009 +0200
@@ -74,7 +74,7 @@
                               ('manage', startup.ManageView),
                               ('owl', owl.OWLView),
                               ('propertiesform', cwproperties.CWPropertiesForm),
-                              ('schema', startup.SchemaView),
+                              ('schema', schema.SchemaView),
                               ('systempropertiesform', cwproperties.SystemCWPropertiesForm)])
 
     def test_possible_views_noresult(self):
@@ -85,7 +85,8 @@
     def test_possible_views_one_egroup(self):
         rset, req = self.env.get_rset_and_req('CWGroup X WHERE X name "managers"')
         self.assertListEqual(self.pviews(req, rset),
-                             [('csvexport', csvexport.CSVRsetView),
+                             [('adaptedlist', baseviews.AdaptedListView),
+                              ('csvexport', csvexport.CSVRsetView),
                               ('ecsvexport', csvexport.CSVEntityView),
                               ('editable-table', tableview.EditableTableView),
                               ('filetree', treeview.FileTreeView),
@@ -107,7 +108,8 @@
     def test_possible_views_multiple_egroups(self):
         rset, req = self.env.get_rset_and_req('CWGroup X')
         self.assertListEqual(self.pviews(req, rset),
-                             [('csvexport', csvexport.CSVRsetView),
+                             [('adaptedlist', baseviews.AdaptedListView),
+                              ('csvexport', csvexport.CSVRsetView),
                               ('ecsvexport', csvexport.CSVEntityView),
                               ('editable-table', tableview.EditableTableView),
                               ('filetree', treeview.FileTreeView),
@@ -130,26 +132,26 @@
         assert self.vreg['views']['propertiesform']
         rset1, req1 = self.env.get_rset_and_req('CWUser X WHERE X login "admin"')
         rset2, req2 = self.env.get_rset_and_req('CWUser X WHERE X login "anon"')
-        self.failUnless(self.vreg.select_object('views', 'propertiesform', req1, rset=None))
-        self.failUnless(self.vreg.select_object('views', 'propertiesform', req1, rset=rset1))
-        self.failUnless(self.vreg.select_object('views', 'propertiesform', req2, rset=rset2))
+        self.failUnless(self.vreg.select('views', 'propertiesform', req1, rset=None))
+        self.failUnless(self.vreg.select('views', 'propertiesform', req1, rset=rset1))
+        self.failUnless(self.vreg.select('views', 'propertiesform', req2, rset=rset2))
 
     def test_propertiesform_anon(self):
         self.login('anon')
         rset1, req1 = self.env.get_rset_and_req('CWUser X WHERE X login "admin"')
         rset2, req2 = self.env.get_rset_and_req('CWUser X WHERE X login "anon"')
-        self.assertRaises(NoSelectableObject, self.vreg.select_object, 'views', 'propertiesform', req1, rset=None)
-        self.assertRaises(NoSelectableObject, self.vreg.select_object, 'views', 'propertiesform', req1, rset=rset1)
-        self.assertRaises(NoSelectableObject, self.vreg.select_object, 'views', 'propertiesform', req1, rset=rset2)
+        self.assertRaises(NoSelectableObject, self.vreg.select, 'views', 'propertiesform', req1, rset=None)
+        self.assertRaises(NoSelectableObject, self.vreg.select, 'views', 'propertiesform', req1, rset=rset1)
+        self.assertRaises(NoSelectableObject, self.vreg.select, 'views', 'propertiesform', req1, rset=rset2)
 
     def test_propertiesform_jdoe(self):
         self.create_user('jdoe')
         self.login('jdoe')
         rset1, req1 = self.env.get_rset_and_req('CWUser X WHERE X login "admin"')
         rset2, req2 = self.env.get_rset_and_req('CWUser X WHERE X login "jdoe"')
-        self.failUnless(self.vreg.select_object('views', 'propertiesform', req1, rset=None))
-        self.assertRaises(NoSelectableObject, self.vreg.select_object, 'views', 'propertiesform', req1, rset=rset1)
-        self.failUnless(self.vreg.select_object('views', 'propertiesform', req2, rset=rset2))
+        self.failUnless(self.vreg.select('views', 'propertiesform', req1, rset=None))
+        self.assertRaises(NoSelectableObject, self.vreg.select, 'views', 'propertiesform', req1, rset=rset1)
+        self.failUnless(self.vreg.select('views', 'propertiesform', req2, rset=rset2))
 
     def test_possible_views_multiple_different_types(self):
         rset, req = self.env.get_rset_and_req('Any X')
@@ -185,7 +187,8 @@
     def test_possible_views_multiple_eusers(self):
         rset, req = self.env.get_rset_and_req('CWUser X')
         self.assertListEqual(self.pviews(req, rset),
-                             [('csvexport', csvexport.CSVRsetView),
+                             [('adaptedlist', baseviews.AdaptedListView),
+                              ('csvexport', csvexport.CSVRsetView),
                               ('ecsvexport', csvexport.CSVEntityView),
                               ('editable-table', tableview.EditableTableView),
                               ('filetree', treeview.FileTreeView),