Exemplo n.º 1
0
 def test_auth_request_valid(self, auth_request):
     self.data['auth_request'] = auth_request
     parsed = AuthorizationInProgressValidator().to_python(self.data)
     self.assertEqual(
         parsed['auth_request'],
         auth_request
     )
Exemplo n.º 2
0
 def test_expires(self):
     self.data['expires'] = "2018-11-28T22:04:44Z"
     parsed = AuthorizationInProgressValidator().to_python(self.data)
     self.assertEqual(
         parsed['expires'],
         datetime(2018, 11, 28, 22, 4, 44, tzinfo=tzutc())
     )
Exemplo n.º 3
0
 def test_from_same_service_valid(self, from_same_service):
     self.data['from_same_service'] = from_same_service
     parsed = AuthorizationInProgressValidator().to_python(self.data)
     self.assertEqual(
         parsed['from_same_service'],
         from_same_service
     )
Exemplo n.º 4
0
 def test_from_same_service_missing(self):
     del self.data['from_same_service']
     parsed = AuthorizationInProgressValidator().to_python(self.data)
     self.assertFalse(parsed['from_same_service'])
Exemplo n.º 5
0
 def test_auth_request_missing(self):
     del self.data['auth_request']
     with self.assertRaises(Invalid):
         AuthorizationInProgressValidator().to_python(self.data)