[web/test] fix test_views
reusing a request for two different view calls leads to badness
--- a/web/test/test_views.py Mon Mar 23 11:08:04 2015 +0100
+++ b/web/test/test_views.py Fri Feb 20 16:18:25 2015 +0100
@@ -55,9 +55,11 @@
def test_sortable_js_added(self):
with self.admin_access.web_request() as req:
+ # sortable.js should not be included by default
rset = req.execute('CWUser X')
- # sortable.js should not be included by default
- self.assertFalse('jquery.tablesorter.js' in self.view('oneline', rset, req=req))
+ self.assertNotIn('jquery.tablesorter.js', self.view('oneline', rset, req=req).source)
+
+ with self.admin_access.web_request() as req:
# but should be included by the tableview
rset = req.execute('Any P,F,S LIMIT 1 WHERE P is CWUser, P firstname F, P surname S')
self.assertIn('jquery.tablesorter.js', self.view('table', rset, req=req).source)