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

Prevent calls to the Transkribus API in unit tests

parent 5287b60e
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,10 @@ class TestTranskribusImport(FixtureAPITestCase):
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json(), {"__all__": ["You have not register your transkribus email"]})
def test_arkindex_has_not_access(self):
@patch("transkribus.TranskribusAPI.list_user_collection")
def test_arkindex_has_not_access(self, mock_transkribus):
# Not a mistake: Transkribus client raises `Exception` directly when it runs out of retries
mock_transkribus.side_effect = Exception("401 Unauthorized")
self.client.force_login(self.user)
response = self.client.post(reverse("api:import-transkribus"), {
"collection_id": "12345",
......
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