summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorThomas Grainger <tagrain@gmail.com>2014-09-24 14:57:07 +0100
committerTim Graham <timograham@gmail.com>2014-09-24 13:05:09 -0400
commit9beca95eb0f2b5c19b6f7824fd75326527132566 (patch)
tree1fcf6a5b4700c316d5fa06dd05d248097050fc71 /docs
parent943716c8ee601f4c12b5e0dc4a04e85c9dbe244b (diff)
[1.6.x] Added SuspiciousOperation to list of caught exceptions in testing docs.
Backport of 21683011d5 from master
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/testing/tools.txt10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index 583b1834b8..6f770bd1b2 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -447,10 +447,12 @@ If you point the test client at a view that raises an exception, that exception
will be visible in the test case. You can then use a standard ``try ... except``
block or :meth:`~unittest.TestCase.assertRaises` to test for exceptions.
-The only exceptions that are not visible to the test client are ``Http404``,
-``PermissionDenied`` and ``SystemExit``. Django catches these exceptions
-internally and converts them into the appropriate HTTP response codes. In these
-cases, you can check ``response.status_code`` in your test.
+The only exceptions that are not visible to the test client are
+:class:`~django.http.Http404`,
+:class:`~django.core.exceptions.PermissionDenied`, :exc:`SystemExit`, and
+:class:`~django.core.exceptions.SuspiciousOperation`. Django catches these
+exceptions internally and converts them into the appropriate HTTP response
+codes. In these cases, you can check ``response.status_code`` in your test.
Persistent state
~~~~~~~~~~~~~~~~