Skip to content
Snippets Groups Projects
Commit da48a56d authored by Valentin Rigal's avatar Valentin Rigal Committed by Theo Lesage
Browse files

Accelerate execution of test_task_details

parent 8967273d
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !2270. Comments created here will be created in the context of that merge request.
......@@ -111,19 +111,18 @@ class TestAPI(FixtureAPITestCase):
resp = self.client.get(reverse("api:task-details", args=[self.task1.id]))
self.assertEqual(resp.status_code, status.HTTP_403_FORBIDDEN)
@expectedFailure
def test_task_details_requires_process_guest(self):
self.process.creator = self.superuser
self.process.save()
self.corpus.memberships.filter(user=self.user).delete()
self.corpus.public = False
self.corpus.save()
@patch("arkindex.project.mixins.get_max_level")
def test_task_details_requires_process_guest(self, get_max_level_mock):
get_max_level_mock.return_value = None
self.client.force_login(self.user)
with self.assertNumQueries(5):
with self.assertNumQueries(3):
resp = self.client.get(reverse("api:task-details", args=[self.task1.id]))
self.assertEqual(resp.status_code, status.HTTP_403_FORBIDDEN)
self.assertEqual(get_max_level_mock.call_count, 1)
self.assertEqual(get_max_level_mock.call_args, call(self.user, self.corpus))
@patch("arkindex.project.aws.s3")
def test_task_details_process_level_corpus(self, s3_mock):
s3_mock.Object.return_value.bucket_name = "ponos"
......
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