Ejemplo n.º 1
0
 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')
Ejemplo n.º 2
0
 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')
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
 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)
Ejemplo n.º 6
0
 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)
Ejemplo n.º 7
0
 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')
Ejemplo n.º 8
0
 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')
Ejemplo n.º 9
0
 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')