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 )
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()) )
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 )
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'])
def test_auth_request_missing(self): del self.data['auth_request'] with self.assertRaises(Invalid): AuthorizationInProgressValidator().to_python(self.data)