-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test to validate the rendered manifest using iiif-prezi.py. A n…
…umber of small changes were made to make the manifest valid.
- Loading branch information
Showing
12 changed files
with
47 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
from django.test import TestCase | ||
from rest_framework.test import APIRequestFactory | ||
from rest_framework.test import APIClient | ||
from rest_framework.test import APITestCase | ||
from .views import ManifestDetail | ||
from .models import Manifest | ||
from iiif_prezi.loader import ManifestReader | ||
import json | ||
import logging | ||
|
||
# Create your tests here. | ||
logger = logging.getLogger(__name__) | ||
|
||
class AnnotationTests(APITestCase): | ||
factory = APIRequestFactory() | ||
fixtures = ['kollections.json', 'manifests.json', 'canvases.json', 'annotations.json'] | ||
|
||
def test_validate_iiif(self): | ||
view = ManifestDetail.as_view() | ||
manifest = Manifest.objects.all().first() | ||
manifest_uri = '/'.join(['/iiif', 'v2', manifest.pid, 'manifest']) | ||
response = self.client.get(manifest_uri) | ||
reader = ManifestReader(response.content, version='2.1') | ||
try: | ||
mf = reader.read() | ||
assert mf.toJSON() | ||
except Exception as error: | ||
raise Exception(error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters