#8393: Test client handler should call set_script_prefix
---------------------------------------+------------------------------------
Reporter: jcassee | Owner: nobody
Status: new | Milestone: 1.0 maybe
Component: Unit test system | Version: SVN
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------+------------------------------------
Comment (by jcassee):
I'm not sure what I can tell you that is not already in the ticket
summary. The patch is trying to fix a problem with this (pseudo-)code in
middleware:
{{{
def process_request(self, request):
prefix = urlresolvers.get_script_prefix()
prefix += <something>
urlresolvers.set_script_prefix(prefix)
}}}
Because the real handlers reset the prefix on every request this works.
The test client, however, does not. This causes tests for this middleware
to fail.
I notice now, however, that these handlers set the prefix ''after the
middleware has loaded''. I now wonder how come this code snippet (which I
tested and use 'in real life') work.
--
Ticket URL: <http://code.djangoproject.com/ticket/8393#comment:3>
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
-~----------~----~----~----~------~----~------~--~---