I have some code like this,

c = Client()
client.get('/myurl/')

where '//myurl' calls view function,

def foo(request):
   ip_addrs = request.META['REMOTE_ADDR']

This view function works when I use a browser, as
request.META['REMOTE_ADDR'] is populated. But when I use test Client,
I get a keyerror, as resquests generated by Clinet()  do not have
request.META['REMOTE_ADDR']  populated.

Related question, how do I set a value on requests.sessions before
making a call to Client().get()
--~--~---------~--~----~------------~-------~--~----~
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