[web/test] Fix broken tests after commit b81adb5e32f9
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 22 Apr 2015 12:05:09 +0200
changeset 10319 0d3ede4865a8
parent 10318 09273cb083e7
child 10320 facbb38c4c1a
[web/test] Fix broken tests after commit b81adb5e32f9 Add missing n3rdf view to RDF view list.
web/test/unittest_viewselector.py
--- a/web/test/unittest_viewselector.py	Wed Jun 11 15:33:09 2014 +0200
+++ b/web/test/unittest_viewselector.py	Wed Apr 22 12:05:09 2015 +0200
@@ -48,7 +48,7 @@
                  debug.SiteInfoAction]
 
 if hasattr(rdf, 'RDFView'): # not available if rdflib not installed
-    RDFVIEWS = [('rdf', rdf.RDFView)]
+    RDFVIEWS = [('rdf', rdf.RDFView), ('n3rdf', rdf.RDFN3View)]
 else:
     RDFVIEWS = []
 
@@ -115,50 +115,51 @@
     def test_possible_views_one_egroup(self):
         with self.admin_access.web_request() as req:
             rset = req.execute('CWGroup X WHERE X name "managers"')
-            self.assertListEqual(self.pviews(req, rset),
-                                 [('csvexport', csvexport.CSVRsetView),
-                                  ('ecsvexport', csvexport.CSVEntityView),
-                                  ('ejsonexport', json.JsonEntityView),
-                                  ('filetree', treeview.FileTreeView),
-                                  ('jsonexport', json.JsonRsetView),
-                                  ('list', baseviews.ListView),
-                                  ('oneline', baseviews.OneLineView),
-                                  ('owlabox', owl.OWLABOXView),
-                                  ('primary', cwuser.CWGroupPrimaryView)] + \
-                                 RDFVIEWS + \
-                                 [('rsetxml', xmlrss.XMLRsetView),
-                                  ('rss', xmlrss.RSSView),
-                                  ('sameetypelist', baseviews.SameETypeListView),
-                                  ('security', management.SecurityManagementView),
-                                  ('table', tableview.RsetTableView),
-                                  ('text', baseviews.TextView),
-                                  ('treeview', treeview.TreeView),
-                                  ('xbel', xbel.XbelView),
-                                  ('xml', xmlrss.XMLView)])
+            self.assertCountEqual(self.pviews(req, rset),
+                                  RDFVIEWS +
+                                  [('csvexport', csvexport.CSVRsetView),
+                                   ('ecsvexport', csvexport.CSVEntityView),
+                                   ('ejsonexport', json.JsonEntityView),
+                                   ('filetree', treeview.FileTreeView),
+                                   ('jsonexport', json.JsonRsetView),
+                                   ('list', baseviews.ListView),
+                                   ('oneline', baseviews.OneLineView),
+                                   ('owlabox', owl.OWLABOXView),
+                                   ('primary', cwuser.CWGroupPrimaryView),
+                                   ('rsetxml', xmlrss.XMLRsetView),
+                                   ('rss', xmlrss.RSSView),
+                                   ('sameetypelist', baseviews.SameETypeListView),
+                                   ('security', management.SecurityManagementView),
+                                   ('table', tableview.RsetTableView),
+                                   ('text', baseviews.TextView),
+                                   ('treeview', treeview.TreeView),
+                                   ('xbel', xbel.XbelView),
+                                   ('xml', xmlrss.XMLView)])
 
     def test_possible_views_multiple_egroups(self):
         with self.admin_access.web_request() as req:
             rset = req.execute('CWGroup X')
-            self.assertListEqual(self.pviews(req, rset),
-                                 [('csvexport', csvexport.CSVRsetView),
-                                  ('ecsvexport', csvexport.CSVEntityView),
-                                  ('ejsonexport', json.JsonEntityView),
-                                  ('filetree', treeview.FileTreeView),
-                                  ('jsonexport', json.JsonRsetView),
-                                  ('list', baseviews.ListView),
-                                  ('oneline', baseviews.OneLineView),
-                                  ('owlabox', owl.OWLABOXView),
-                                  ('primary', cwuser.CWGroupPrimaryView)] + RDFVIEWS + [
-                                  ('rsetxml', xmlrss.XMLRsetView),
-                                  ('rss', xmlrss.RSSView),
-                                  ('sameetypelist', baseviews.SameETypeListView),
-                                  ('security', management.SecurityManagementView),
-                                  ('table', tableview.RsetTableView),
-                                  ('text', baseviews.TextView),
-                                  ('treeview', treeview.TreeView),
-                                  ('xbel', xbel.XbelView),
-                                  ('xml', xmlrss.XMLView),
-                                  ])
+            self.assertCountEqual(self.pviews(req, rset),
+                                  RDFVIEWS +
+                                  [('csvexport', csvexport.CSVRsetView),
+                                   ('ecsvexport', csvexport.CSVEntityView),
+                                   ('ejsonexport', json.JsonEntityView),
+                                   ('filetree', treeview.FileTreeView),
+                                   ('jsonexport', json.JsonRsetView),
+                                   ('list', baseviews.ListView),
+                                   ('oneline', baseviews.OneLineView),
+                                   ('owlabox', owl.OWLABOXView),
+                                   ('primary', cwuser.CWGroupPrimaryView),
+                                   ('rsetxml', xmlrss.XMLRsetView),
+                                   ('rss', xmlrss.RSSView),
+                                   ('sameetypelist', baseviews.SameETypeListView),
+                                   ('security', management.SecurityManagementView),
+                                   ('table', tableview.RsetTableView),
+                                   ('text', baseviews.TextView),
+                                   ('treeview', treeview.TreeView),
+                                   ('xbel', xbel.XbelView),
+                                   ('xml', xmlrss.XMLView),
+                                   ])
 
     def test_propertiesform_admin(self):
         assert self.vreg['views']['propertiesform']
@@ -191,24 +192,25 @@
     def test_possible_views_multiple_different_types(self):
         with self.admin_access.web_request() as req:
             rset = req.execute('Any X')
-            self.assertListEqual(self.pviews(req, rset),
-                                 [('csvexport', csvexport.CSVRsetView),
-                                  ('ecsvexport', csvexport.CSVEntityView),
-                                  ('ejsonexport', json.JsonEntityView),
-                                  ('filetree', treeview.FileTreeView),
-                                  ('jsonexport', json.JsonRsetView),
-                                  ('list', baseviews.ListView),
-                                  ('oneline', baseviews.OneLineView),
-                                  ('owlabox', owl.OWLABOXView),
-                                  ('primary', primary.PrimaryView),] + RDFVIEWS + [
-                                  ('rsetxml', xmlrss.XMLRsetView),
-                                  ('rss', xmlrss.RSSView),
-                                  ('security', management.SecurityManagementView),
-                                  ('table', tableview.RsetTableView),
-                                  ('text', baseviews.TextView),
-                                  ('treeview', treeview.TreeView),
-                                  ('xbel', xbel.XbelView),
-                                  ('xml', xmlrss.XMLView),
+            self.assertCountEqual(self.pviews(req, rset),
+                                  RDFVIEWS +
+                                  [('csvexport', csvexport.CSVRsetView),
+                                   ('ecsvexport', csvexport.CSVEntityView),
+                                   ('ejsonexport', json.JsonEntityView),
+                                   ('filetree', treeview.FileTreeView),
+                                   ('jsonexport', json.JsonRsetView),
+                                   ('list', baseviews.ListView),
+                                   ('oneline', baseviews.OneLineView),
+                                   ('owlabox', owl.OWLABOXView),
+                                   ('primary', primary.PrimaryView),
+                                   ('rsetxml', xmlrss.XMLRsetView),
+                                   ('rss', xmlrss.RSSView),
+                                   ('security', management.SecurityManagementView),
+                                   ('table', tableview.RsetTableView),
+                                   ('text', baseviews.TextView),
+                                   ('treeview', treeview.TreeView),
+                                   ('xbel', xbel.XbelView),
+                                   ('xml', xmlrss.XMLView),
                                   ])
 
     def test_possible_views_any_rset(self):
@@ -224,28 +226,29 @@
     def test_possible_views_multiple_eusers(self):
         with self.admin_access.web_request() as req:
             rset = req.execute('CWUser X')
-            self.assertListEqual(self.pviews(req, rset),
-                                 [('csvexport', csvexport.CSVRsetView),
-                                  ('ecsvexport', csvexport.CSVEntityView),
-                                  ('ejsonexport', json.JsonEntityView),
-                                  ('filetree', treeview.FileTreeView),
-                                  ('foaf', cwuser.FoafView),
-                                  ('jsonexport', json.JsonRsetView),
-                                  ('list', baseviews.ListView),
-                                  ('oneline', baseviews.OneLineView),
-                                  ('owlabox', owl.OWLABOXView),
-                                  ('primary', primary.PrimaryView)] + RDFVIEWS + [
-                                  ('rsetxml', xmlrss.XMLRsetView),
-                                  ('rss', xmlrss.RSSView),
-                                  ('sameetypelist', baseviews.SameETypeListView),
-                                  ('security', management.SecurityManagementView),
-                                  ('table', tableview.RsetTableView),
-                                  ('text', baseviews.TextView),
-                                  ('treeview', treeview.TreeView),
-                                  ('vcard', vcard.VCardCWUserView),
-                                  ('xbel', xbel.XbelView),
-                                  ('xml', xmlrss.XMLView),
-                                  ])
+            self.assertCountEqual(self.pviews(req, rset),
+                                  RDFVIEWS +
+                                  [('csvexport', csvexport.CSVRsetView),
+                                   ('ecsvexport', csvexport.CSVEntityView),
+                                   ('ejsonexport', json.JsonEntityView),
+                                   ('filetree', treeview.FileTreeView),
+                                   ('foaf', cwuser.FoafView),
+                                   ('jsonexport', json.JsonRsetView),
+                                   ('list', baseviews.ListView),
+                                   ('oneline', baseviews.OneLineView),
+                                   ('owlabox', owl.OWLABOXView),
+                                   ('primary', primary.PrimaryView),
+                                   ('rsetxml', xmlrss.XMLRsetView),
+                                   ('rss', xmlrss.RSSView),
+                                   ('sameetypelist', baseviews.SameETypeListView),
+                                   ('security', management.SecurityManagementView),
+                                   ('table', tableview.RsetTableView),
+                                   ('text', baseviews.TextView),
+                                   ('treeview', treeview.TreeView),
+                                   ('vcard', vcard.VCardCWUserView),
+                                   ('xbel', xbel.XbelView),
+                                   ('xml', xmlrss.XMLView),
+                                   ])
 
     def test_possible_actions_none_rset(self):
         with self.admin_access.web_request() as req: