Пример #1
0
    def test_api_verifier_resolve_request(self):
        create_request()
        verify_request = Identity(api.take_next_request()['result'])

        today = datetime.combine(date.today(), datetime.min.time())
        x = VerificationResponse(True, None, verify_request, today.isoformat(),
                                 True, True, True, True)

        response = api.verifier_resolve_request(verify_request.id, x.to_dict())
        self.assertFalse("error" in response)

        create_request()
        verify_request = Identity(api.take_next_request()['result'])
        x = VerificationResponse(False, "this is the rejection reason",
                                 verify_request, None, True, True, False, True)

        response = api.verifier_resolve_request(verify_request.id, x.to_dict())
        self.assertFalse("error" in response)
Пример #2
0
    def test_api_verifier_resolve_request(self):
        create_request()
        verify_request = Identity(api.take_next_request()['result'])

        today = datetime.combine(date.today(), datetime.min.time())
        x = VerificationResponse(True, None, verify_request, today.isoformat(),
                                 True, True, True, True)

        response = api.verifier_resolve_request(verify_request.id, x.to_dict())
        self.assertFalse("error" in response)

        create_request()
        verify_request = Identity(api.take_next_request()['result'])
        x = VerificationResponse(False, "this is the rejection reason",
                                 verify_request, None, True, True, False, True)

        response = api.verifier_resolve_request(verify_request.id, x.to_dict())
        self.assertFalse("error" in response)
Пример #3
0
class TestVerificationResponse(unittest.TestCase):
    def setUp(self):
        """Call before every test case."""

        self.response = VerificationResponse(
            True, 'rejection reason', Identity(), '2014-1-1', True, True,
            True, False)

    def test_verification_response_property_accepted(self):
        self.assertTrue(self.response.accepted)

    def test_verification_response_to_json(self):
        self.response.to_json()

    def test_verification_response_to_dict(self):
        self.assertEquals(self.response.to_dict()['expiration_date'],
                          '2014-1-1')
Пример #4
0
class TestVerificationResponse(unittest.TestCase):
    def setUp(self):
        """Call before every test case."""

        self.response = VerificationResponse(True, 'rejection reason',
                                             Identity(), '2014-1-1', True,
                                             True, True, False)

    def test_verification_response_property_accepted(self):
        self.assertTrue(self.response.accepted)

    def test_verification_response_to_json(self):
        self.response.to_json()

    def test_verification_response_to_dict(self):
        self.assertEquals(self.response.to_dict()['expiration_date'],
                          '2014-1-1')