Exemple #1
0
    def test_get_verification_from_receipt(self):
        result = SoftwareSecurePhotoVerification.get_verification_from_receipt(
            '')
        assert result is None

        user = UserFactory.create()
        attempt = SoftwareSecurePhotoVerification(user=user)
        attempt.status = PhotoVerification.STATUS.submitted
        attempt.save()
        receipt_id = attempt.receipt_id
        result = SoftwareSecurePhotoVerification.get_verification_from_receipt(
            receipt_id)
        assert result is not None
Exemple #2
0
    def get(self, request, receipt_id):
        """
        Endpoint for retrieving photo urls for IDV
        GET /verify_student/photo_urls/{receipt_id}

        Returns:
            200 OK
            {
                "EdX-ID": receipt_id,
                "ExpectedName": user profile name,
                "PhotoID": id photo S3 url,
                "PhotoIDKey": encrypted photo id key,
                "UserPhoto": face photo S3 url,
                "UserPhotoKey": encrypted user photo key,
            }
        """
        verification = SoftwareSecurePhotoVerification.get_verification_from_receipt(
            receipt_id)
        if verification:
            _, body = verification.create_request()
            # remove this key, as it isn't needed
            body.pop('SendResponseTo')
            return Response(body)

        log.warning(u"Could not find verification with receipt ID %s.",
                    receipt_id)
        raise Http404