#4457: Using a custom test suite, django.test.TestCase-based tests either fail
silently (DEBUG = True) or fail with a generic error message (DEBUG =
False)
------------------------------------------------+---------------------------
Reporter: Chris Wagner <[EMAIL PROTECTED]> | Owner: adrian
Status: new | Component: Unit
test system
Version: SVN | Resolution:
Keywords: | Stage: Design
decision needed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
------------------------------------------------+---------------------------
Comment (by Chris Wagner <[EMAIL PROTECTED]>):
Coincidentally, I was writing this up just as Jacob posted. I'll go ahead
and post it anyway....
---------
According to the Django documentation (at
http://www.djangoproject.com/documentation/testing/#test-client):
{{{
Exceptions
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...catch block, or unittest.TestCase.assertRaises() to test for
exceptions.
The only exceptions that are not visible in a Test Case are Http404,
PermissionDenied and SystemExit. Django catches these exceptions
internally and converts them into the appropriate HTTP responses codes.
}}}
Doesn't that contradict with what I'm seeing? I assume that, that means I
should see any exception raised from one of my "''views''" (except for, of
course, Http404, !PermissionDenied and !SystemExit exceptions), regardless
of whether I have DEBUG set or not. Furthermore, I shouldn't see a
!TemplateDoesNotExist exception, because, if Django is already trying to
render an error template, then it must have already ''captured'' the
exception that was raised within my ''view''.
--
Ticket URL: <http://code.djangoproject.com/ticket/4457#comment:6>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---