Opened 8 years ago

Closed 8 years ago

#3452 closed (worksforme)

Need mechanism for disabling exception supression when running in test context

Reported by: Simon Willison Owned by: adrian
Component: Testing framework Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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.

Change History (3)

comment:1 Changed 8 years ago by Michael Radziej <mir@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 8 years ago by Michael Radziej <mir@…>

#1514 marked as duplicate

comment:3 Changed 8 years ago by Michael Radziej <mir@…>

  • Resolution set to worksforme
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.
Back to Top