My application has a view that accepts a string parameter and filters
a model based on that parameter. In the development environment the
view works well when passed a string with a space in it, say 'hello
world'. The portion of the url representing the parameter shows up as
'hello%20world'.

I then wrote a test for the view using Django's test client. I used
the utility reverse() method to pass the path to Client().get(). The
test failed (the query set was empty) for the very same string.

Puzzled, I added a print statement inside the view to print the
parameter. When accessed in the development environment the parameter
showed up as 'hello world'. However on running the test it showed up
as 'hello%20world'. The latter caused the database lookup to return
empty.

Can anyone explain why there is such a difference in behaviour?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to