Skip to content
Snippets Groups Projects
Commit 6d568a27 authored by Erwan Rouchet's avatar Erwan Rouchet Committed by Bastien Abadie
Browse files

Add IIIF manifest validation using Tripoli

parent c463c32f
No related branches found
Tags 1.2.0-rc1
1 merge request!15IIIF manifest validation
......@@ -17,3 +17,4 @@ requests==2.18.4
roman==2.0.0
urllib3==1.22
ijson==2.3
tripoli==2.0.0
......@@ -2,6 +2,7 @@ from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APITestCase
from rest_framework import status
from tripoli import IIIFValidator
from documents.models import Document, DocumentLink, DocumentType, Page
from images.models import ImageServer, Image
......@@ -145,3 +146,11 @@ class TestVolumeManifestSerializer(APITestCase):
self.assertEqual(len(topstruct['ranges']), 0)
self.assertEqual(len(manifest['sequences']), 1)
self.assertEqual(len(manifest['sequences'][0]['canvases']), 0)
def test_normal_manifest_iiif_validation(self):
response = self.client.get(reverse('api:volume-manifest', kwargs={'pk': self.vol.id}))
self.assertEqual(response.status_code, status.HTTP_200_OK)
manifest = response.json()
iv = IIIFValidator()
iv.validate(manifest)
assert iv.is_valid
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment