[web/test] fix test_views
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 20 Feb 2015 16:18:25 +0100
changeset 10282 f96093ad32e4
parent 10281 cc9eb88377f4
child 10283 8e6aa8ed6ee1
[web/test] fix test_views reusing a request for two different view calls leads to badness
web/test/test_views.py
--- 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)