def setUp(self):
     self.user = User.create_user('user1', '*****@*****.**',
                                  'user1pass')
     jwt_payload_handler = api_settings.JWT_PAYLOAD_HANDLER
     jwt_encode_handler = api_settings.JWT_ENCODE_HANDLER
     payload = jwt_payload_handler(self.user)
     token = jwt_encode_handler(payload)
     self.client.credentials(HTTP_AUTHORIZATION='JWT ' + token)
     AnnotationList(
         label="annotationList1",
         identifier="book1",
         name="annotationList1",
         ATid="http://example.org/iiif/book1/list/annotationList1",
         viewingHint="paged",
         ownedBy=["user1"]).save()
     AnnotationList(
         label="annotationList2",
         identifier="book1",
         name="annotationList2",
         ATid="http://example.org/iiif/book1/list/annotationList2",
         ownedBy=["user1"]).save()
     data = {"annotationList": json.loads(open(ANNOTATIONLIST_FULL).read())}
     response = self.client.post(URL, data)
     if settings.QUEUE_POST_ENABLED:
         while self.client.get(
                 response.data["status"]
         ).status_code != status.HTTP_301_MOVED_PERMANENTLY:
             pass  # Wait till background process finishes
         response = self.client.get(response.data["status"])
 def setUp(self):
     AnnotationList(
         label="annotationList1",
         identifier="book1",
         name="annotationList1",
         ATid="http://example.org/iiif/book1/list/annotationList1").save()
     AnnotationList(
         label="annotationList2",
         identifier="book1",
         name="annotationList2",
         ATid="http://example.org/iiif/book1/list/annotationList2").save()
     AnnotationList(
         label="annotationList3",
         identifier="book1",
         name="annotationList3",
         ATid="http://example.org/iiif/book1/list/annotationList3").save()
 def setUp(self):
     self.user = User.create_user('user1', '*****@*****.**',
                                  'user1pass')
     jwt_payload_handler = api_settings.JWT_PAYLOAD_HANDLER
     jwt_encode_handler = api_settings.JWT_ENCODE_HANDLER
     payload = jwt_payload_handler(self.user)
     token = jwt_encode_handler(payload)
     self.client.credentials(HTTP_AUTHORIZATION='JWT ' + token)
     AnnotationList(
         label="annotationList1",
         identifier="book1",
         name="annotationList1",
         ATid="http://example.org/iiif/book1/list/annotationList1",
         ownedBy=["user1"]).save()
     AnnotationList(
         label="annotationList2",
         identifier="book1",
         name="annotationList2",
         ATid="http://example.org/iiif/book1/list/annotationList2",
         ownedBy=["user1"]).save()
Exemple #4
0
 def setUp(self):
     AnnotationList(label="cool list", identifier="book1", name="list1", ATid="http://example.org/iiif/book1/list1").save()
     AnnotationList(label="not so cool list", identifier="book1", name="list2", ATid="http://example.org/iiif/book1/list2").save()
     AnnotationList(label="cool list", identifier="book2", name="list3", ATid="http://example.org/iiif/book2/list3").save()
     self.url = "/search/list/"