# HG changeset patch # User Julien Cristau # Date 1424445505 -3600 # Node ID f96093ad32e41f7caf5fd21f38dd8c800e362484 # Parent cc9eb88377f4e95cc65281531bf5902afeacdcd5 [web/test] fix test_views reusing a request for two different view calls leads to badness diff -r cc9eb88377f4 -r f96093ad32e4 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)