Django

Code

Ticket #3452 (closed: worksforme)

Opened 2 years ago

Last modified 2 years ago

Need mechanism for disabling exception supression when running in test context

Reported by: Simon Willison Assigned to: adrian
Milestone: Component: Testing framework
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

BaseHandler?.get_response is currently an exception black hole - if an exception occurs anywhere in a Django application there appears to be no circumstance in which it will not be turned in to an HttpResponse of some sort - the DEBUG setting merely influences if the error message is highly descriptive (in debug mode) or user-friendly.

This is great for 99% of situations, but is an absolute nuisance when using in-process testing against Django, for example using django.test.client.Client.

It would be really useful if there was a way of telling Django to raise any exceptions caught in that last naked 'except' clause (line 108), for purposes of unit testing.

Attachments

Change History

02/15/07 15:53:07 changed by Michael Radziej <mir@noris.de>

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

I think this has been fixed with changeset 4482, can you please check?

02/15/07 16:01:11 changed by Michael Radziej <mir@noris.de>

#1514 marked as duplicate

02/21/07 14:51:40 changed by Michael Radziej <mir@noris.de>

  • status changed from new to closed.
  • resolution set to worksforme.

No feedback? Then I consider it fixed. Please reopen the ticket if it persists.


Add/Change #3452 (Need mechanism for disabling exception supression when running in test context)




Change Properties
Action