Skip to content
Snippets Groups Projects
Commit 27aeb707 authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Merge branch 'missing-transkribus-mock' into 'master'

Prevent calls to the Transkribus API in unit tests

Closes #479

See merge request !1113
parents 12948ce3 1ef4ec3a
No related branches found
No related tags found
1 merge request!1113Prevent calls to the Transkribus API in unit tests
......@@ -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