Missing setting overrides on Transkribus import tests
After #1364 (closed), because I was too lazy to look for a valid worker version ID, I turned off the Transkribus import in my local setup. It turns out that this causes 5 tests to always fail:
Test logs
======================================================================
FAIL: test_arkindex_has_not_access (arkindex.process.tests.test_transkribus_import.TestTranskribusImport)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.8/unittest/mock.py", line 1325, in patched
return func(*newargs, **newkeywargs)
File "/home/lucidiot/dev/ark/backend/arkindex/process/tests/test_transkribus_import.py", line 77, in test_arkindex_has_not_access
self.assertEqual(response.json(), {"collection_id" : ["User arkindex@teklia.com is not a member of the collection 12345"]})
AssertionError: ['Transkribus import is unavailable due t[38 chars]ed.'] != {'collection_id': ['User arkindex@teklia.[41 chars]45']}
======================================================================
FAIL: test_corpus_worker_version_list_transkribus (arkindex.process.tests.test_transkribus_import.TestTranskribusImport)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/lucidiot/.virtualenvs/backend/lib/python3.8/site-packages/django/test/utils.py", line 460, in inner
return func(*args, **kwargs)
File "/usr/lib/python3.8/unittest/mock.py", line 1325, in patched
return func(*newargs, **newkeywargs)
File "/home/lucidiot/dev/ark/backend/arkindex/process/tests/test_transkribus_import.py", line 167, in test_corpus_worker_version_list_transkribus
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
AssertionError: 400 != 201
======================================================================
FAIL: test_create_import (arkindex.process.tests.test_transkribus_import.TestTranskribusImport)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/lucidiot/.virtualenvs/backend/lib/python3.8/site-packages/django/test/utils.py", line 460, in inner
return func(*args, **kwargs)
File "/usr/lib/python3.8/unittest/mock.py", line 1325, in patched
return func(*newargs, **newkeywargs)
File "/home/lucidiot/dev/ark/backend/arkindex/process/tests/test_transkribus_import.py", line 104, in test_create_import
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
AssertionError: 400 != 201
======================================================================
FAIL: test_requires_transkribus_email (arkindex.process.tests.test_transkribus_import.TestTranskribusImport)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/lucidiot/dev/ark/backend/arkindex/process/tests/test_transkribus_import.py", line 66, in test_requires_transkribus_email
self.assertEqual(response.json(), {"__all__": ["You have not registered your transkribus email"]})
AssertionError: ['Transkribus import is unavailable due t[38 chars]ed.'] != {'__all__': ['You have not registered you[17 chars]il']}
======================================================================
FAIL: test_user_has_not_access (arkindex.process.tests.test_transkribus_import.TestTranskribusImport)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.8/unittest/mock.py", line 1325, in patched
return func(*newargs, **newkeywargs)
File "/home/lucidiot/dev/ark/backend/arkindex/process/tests/test_transkribus_import.py", line 88, in test_user_has_not_access
self.assertEqual(response.json(), {"collection_id": ["User nope@nope.fr is not a member of the collection 12345"]})
AssertionError: ['Transkribus import is unavailable due t[38 chars]ed.'] != {'collection_id': ['User nope@nope.fr is [34 chars]45']}
Those tests probably are just missing some @override_settings(ARKINDEX_FEATURES={'transkribus': True})
.