Re: In unitTest, GET Formset returns 302 instead of 200

2011-09-07 Thread Xinlei CHEN
@Malcolm, Sorry It should be some bad pastes :( Finally, I have solved the problem using the following 2 lines: c = Client() c.login(username='alex...@e.com', password='alex') In fact, I can't login in with the following code self.client.login(username='alex...@e.com', password='alex') I don't

Re: In unitTest, GET Formset returns 302 instead of 200

2011-09-07 Thread Malcolm Box
On 7 September 2011 11:52, MATHIEU wrote: > For the GET method, I have tried the following code: > >def test_patron_phone_get_form(self): >self.client.login(usernamer='alex...@e.com', > password='alex') >response = self.client.get(rever

In unitTest, GET Formset returns 302 instead of 200

2011-09-07 Thread MATHIEU
Hi, I want to test the GET method for an inline formset. The view in which the inline formset is created is as follows: @login_required def patron_edit_phone(request, *args, **kwargs): patron = request.user PhoneNumberFormSet = inlineformset_