From 21683011d5b46806d12106a3079b704ed41cd261 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 24 Sep 2014 14:57:07 +0100 Subject: [PATCH] Added SuspiciousOperation to list of caught exceptions in testing docs. --- docs/topics/testing/tools.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt index 60bd082d07..7bbc441183 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -462,10 +462,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 ~~~~~~~~~~~~~~~~