Example #1
0
 def test_get_verification_details_by_id(self, kwargs):
     user = UserFactory.create()
     kwargs['user'] = user
     sspv = SoftwareSecurePhotoVerification.objects.create(**kwargs)
     attempt = IDVerificationService.get_verification_details_by_id(sspv.id)
     assert attempt.id == sspv.id
     assert attempt.user.id == user.id
     assert attempt.status == kwargs['status']
     assert attempt.error_msg == kwargs['error_msg']
Example #2
0
    def test_get_verification_details_other_types(self, verification_model, kwargs):
        user = UserFactory.create()
        kwargs['user'] = user
        model_object = verification_model.objects.create(**kwargs)

        attempt = IDVerificationService.get_verification_details_by_id(model_object.id)
        assert attempt.id == model_object.id
        assert attempt.user.id == user.id
        assert attempt.status == kwargs['status']
Example #3
0
 def get(self, request, **kwargs):
     """
     Get IDV attempt details by attempt_id. Only accessible by global staff.
     """
     attempt_id = kwargs.get('attempt_id')
     verification_detail = IDVerificationService.get_verification_details_by_id(attempt_id)
     if not verification_detail:
         raise Http404
     return Response(
         IDVerificationDetailsSerializer(verification_detail).data
     )
Example #4
0
 def test_get_verification_details_not_found(self, verification_model):
     user = UserFactory.create()
     model_object = verification_model.objects.create(user=user)
     not_found_id = model_object.id + randint(100, 200)
     attempt = IDVerificationService.get_verification_details_by_id(not_found_id)
     assert attempt is None