On 12/19/06, Afternoon <[EMAIL PROTECTED]> wrote:

Currently any exception raised by a view or other request machinery
while handling a request from the test client is hidden from the
requesting test case by Django's exception views (500, error debug). I
have created a patch and a ticket for an enhancement which reraises
exceptions with the original stack information after request processing
has completed. The exception bubbles back up to the test case, which
allows the cause to be found and fixed easily.

As test cases provide a regression safety net, it is useful to be able
to do this. Without the option to inspect exceptions raised during the
test run, developers have to recreate the test themselves to get to all
the contextual information required to isolate the cause, slowing the
testing process significantly.

The current patch introduces the code outright, but it could also be
made into an option, perhaps with a parameter passed to the Client
constructor.

http://code.djangoproject.com/ticket/3162

Again, I've assigned the ticket to Russ, as he is the original author
of the test client.

Again, looks good. The signal based approach is very clever. Some
comments (and some of these will be familiar following my feedback on
#3160):

1) Needs a test case.

2) Needs documentation.

3) There is a minor problem in that the got_request_exception signal
is only issued if the project is NOT in debug mode. Since tests can be
run in either mode, this means that test behaviour will be
unpredictable. One possible fix would be to move the dispatcher.send
call in core/handlers/base.py so that the signal is _always_ sent. The
only side effect I can think of is that transactions will be rolled
back when in debug mode. However, there might be other problems with
this approach.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to