summaryrefslogtreecommitdiff
path: root/tests/modeltests/test_client/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modeltests/test_client/models.py')
-rw-r--r--tests/modeltests/test_client/models.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/modeltests/test_client/models.py b/tests/modeltests/test_client/models.py
index b6c3fbd5b1..74f5e9700c 100644
--- a/tests/modeltests/test_client/models.py
+++ b/tests/modeltests/test_client/models.py
@@ -114,4 +114,14 @@ class ClientTest(unittest.TestCase):
# Check that the session was modified
self.assertEquals(self.client.session['tobacconist'], 'hovercraft')
- \ No newline at end of file
+
+ def test_view_with_exception(self):
+ "Request a page that is known to throw an error"
+ self.assertRaises(KeyError, self.client.get, "/test_client/broken_view/")
+
+ #Try the same assertion, a different way
+ try:
+ self.client.get('/test_client/broken_view/')
+ self.fail('Should raise an error')
+ except KeyError:
+ pass