39 class MyWebTest(CubicWebTC): |
39 class MyWebTest(CubicWebTC): |
40 |
40 |
41 def test_error_view(self): |
41 def test_error_view(self): |
42 with self.admin_access.web_request() as req: |
42 with self.admin_access.web_request() as req: |
43 req.create_entity('Bug', title=u"bt") |
43 req.create_entity('Bug', title=u"bt") |
44 self.view('raising', req.execute('Bug B'), template=None) |
44 self.view('raising', req.execute('Bug B'), template=None, req=req) |
45 |
45 |
46 def test_correct_view(self): |
46 def test_correct_view(self): |
47 with self.admin_access.web_request() as req: |
47 with self.admin_access.web_request() as req: |
48 self.view('primary', req.execute('CWUser U'), template=None) |
48 self.view('primary', req.execute('CWUser U'), template=None, req=req) |
49 |
49 |
50 tests = [MyWebTest('test_error_view'), MyWebTest('test_correct_view')] |
50 tests = [MyWebTest('test_error_view'), MyWebTest('test_correct_view')] |
51 result = self.runner.run(TestSuite(tests)) |
51 result = self.runner.run(TestSuite(tests)) |
52 self.assertEqual(result.testsRun, 2) |
52 self.assertEqual(result.testsRun, 2) |
53 self.assertEqual(len(result.errors), 0) |
53 self.assertEqual(len(result.errors), 0) |