Re: Testing and request META data

2009-12-28 Thread Phlip
> Now how do I test an action that must use SSL? (I want a 304 bounce > message if the user tries to use plain text.) This looks promising! class SSLAwareClient(Client): def __init__(self, *args, **kwargs): super(SSLAwareClient, self).__init__(*args, **kwargs) self.ssl = False

Re: Testing and request META data

2009-12-22 Thread Phlip
> >>> c = Client() > >>> c.get('/customers/details/', {'name': 'fred', 'age': 7}, > > ...       HTTP_X_REQUESTED_WITH='XMLHttpRequest') Thanks! Now how do I test an action that must use SSL? (I want a 304 bounce message if the user tries to use plain text.) I couldn't find a HTTPS or similar hea

Re: Testing and request META data

2009-12-09 Thread Russell Keith-Magee
On Thu, Dec 10, 2009 at 2:06 AM, Phlip wrote: > On Aug 14 2008, 5:39 am, "Hajo Smulders" > wrote: > >> I need to set the HTTP_REFERER in the request.META data of a test client so >> that i can unit test a view. >> How do I do this? ie: How do i fake an HTTP header on a test client? > > Bump? I ju

Testing and request META data

2009-12-09 Thread Phlip
On Aug 14 2008, 5:39 am, "Hajo Smulders" wrote: > I need to set the HTTP_REFERER in the request.META data of a test client so > that i can unit test a view. > How do I do this? ie: How do i fake an HTTP header on a test client? Bump? I just hit this problem, and the above question is the only tr