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

Test that CreateTranscriptions requires a worker version or run

parent eded165a
No related branches found
No related tags found
1 merge request!1868Test that CreateTranscriptions requires a worker version or run
......@@ -348,3 +348,21 @@ class TestBulkTranscriptions(FixtureAPITestCase):
self.assertDictEqual(response.json(), {
'non_field_errors': ['Only one of `worker_version` and `worker_run_id` may be set.']
})
def test_bulk_transcriptions_requires_version_xor_run(self):
self.client.force_login(self.user)
test_element = self.corpus.elements.get(name='Volume 2, page 1r')
response = self.client.post(reverse('api:transcription-bulk'), {
"transcriptions": [
{
"element_id": str(test_element.id),
"text": "The Glow Cloud does not need to converse with us.",
"orientation": TextOrientation.VerticalRightToLeft.value,
"confidence": 0.33
},
],
}, format='json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertDictEqual(response.json(), {
'non_field_errors': ['Either `worker_run_id` or `worker_version` must be defined.']
})
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