def test_psp_reference(self): self.params['pspReference'] = 'reference' params = sign_params(self.params) params['csrfmiddlewaretoken'] = self._get_csrf_token() response = self.app.post(self.url, params=params) self.assertEqual(response.status_code, 200) self.assertEqual(response.text, '\n Success!\n\n')
def test_post(self): self.params['authResult'] = 'AUTHORISED' params = sign_params(self.params) params['csrfmiddlewaretoken'] = self._get_csrf_token() response = self.app.post(self.url, params=params) self.assertEqual(response.status_code, 200) self.assertEqual(response.text, '\n Success!\n\n')
def test_other_response(self): self.params['authResult'] = 'OTHER' params = sign_params(self.params) with self.assertRaises(NotImplementedError): self.app.get(self.url, params=params)
def test_authorised_response(self): self.params['authResult'] = 'AUTHORISED' params = sign_params(self.params) with self.assertRaises(NotImplementedError): self.app.get(self.url, params=params)
def test_pending_response(self): self.params['authResult'] = 'PENDING' params = sign_params(self.params) with self.assertRaises(NotImplementedError): self.app.get(self.url, params=params)
def test_cancelled_response(self): self.params['authResult'] = 'CANCELLED' params = sign_params(self.params) with self.assertRaises(NotImplementedError): self.app.get(self.url, params=params)
def test_other_response(self): self.params['authResult'] = 'OTHER' params = sign_params(self.params) response = self.app.get(self.url, params=params) self.assertEqual(response.status_code, 200) self.assertEqual(response.text, '\n Success!\n\n')
def test_authorised_response(self): self.params['authResult'] = 'AUTHORISED' params = sign_params(self.params) response = self.app.get(self.url, params=params) self.assertEqual(response.status_code, 200) self.assertEqual(response.text, '\n Success!\n\n')
def test_cancelled_response(self): self.params['authResult'] = 'CANCELLED' params = sign_params(self.params) response = self.app.get(self.url, params=params) self.assertEqual(response.status_code, 200) self.assertEqual(response.text, '\n Success!\n\n')