web/test/unittest_application.py
branchstable
changeset 6796 e70ca9abfc51
parent 6340 470d8e828fda
child 6797 90d687bd4c52
--- a/web/test/unittest_application.py	Fri Jan 07 18:51:50 2011 +0100
+++ b/web/test/unittest_application.py	Mon Jan 10 12:28:09 2011 +0100
@@ -298,8 +298,9 @@
 
     def test_login_not_available_to_authenticated(self):
         req = self.request()
-        ex = self.assertRaises(Unauthorized, self.app_publish, req, 'login')
-        self.assertEqual(str(ex), 'log out first')
+        with self.assertRaises(Unauthorized) as cm:
+            self.app_publish(req, 'login')
+        self.assertEqual(str(cm.exception), 'log out first')
 
     def test_fb_login_concept(self):
         """see data/views.py"""