def test_post_without_next_arg(self): factory = RequestFactory() request = factory.post('/test', data={'test': 'data'}) response = csrf_failure(request, '') self.assertEqual(response.status_code, 302) self.assertEqual(response.url, '/')
def test_get(self): factory = RequestFactory() request = factory.get('/') response = csrf_failure(request, '') self.assertEqual(response.status_code, 403)