I need to give post
in my view of "creation of requests", but when I try to give post
, I'm redirected to my login screen, I'm trying to login to the system and then give the post in that view , but I did not succeed. Could someone help me?
tests.py
class OrderRegisterView(TestCase):
def test_order_register_view(self):
c = Client()
User.objects.create_user('teste', 'teste', 'teste')
c.login(username='teste', password='teste', follow=True)
response = c.post('/pedidos/cadastro/', {'username':'teste', 'password': 'teste','ship_date':'12/04/14', 'ship_time': 'morning', 'truck': 7, 'city': 4304606, 'value': 12, 'action': 'selected', 'cheapest': True}, follow=True)
# self.assertRedirects(response, '/login/')
I do not go from there, it does not give me any errors, it just happens OK.