Hi , will some help with this please ,
I am writting a django unittest for a web app. when i do a post like that : r = self.client.post(reverse('login'), {'username': 'te...@hotmail.com', 'password': '12345'})
print 'logins page load>>', r.status_code
the status code returns 302. it's that normal ?
after i try to add some data to the create view like this :
def test_brand_create(self):
r = self.client.get(reverse('brand_new'), follow=True)
self.assertEqual(r.status_code, 200, msg="brand_new Page loads")
print 'brand_new loads >>>',r.status_code
r = self.client.post(brand/new/', {'name': 'poko'})
print 'brand new post>>>' ,r.status_code
brand = Brand.objects.get(name='poko') ( this doesn't return anything error:>>> (DoesNotExist: Brand matching query does not exist.) it seems that the values didn't get posted via the url )
self.assertIsNotNone(brand, msg="brand object created")
print "brand object created>>>",brand
any idea what am doing wrong ?