Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
c6405687
Commit
c6405687
authored
11 months ago
by
Valentin Rigal
Committed by
Erwan Rouchet
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Accelerate execution of test_task_details
parent
f03910d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2265
Accelerate execution of test_task_details
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex/ponos/tests/test_api.py
+7
-8
7 additions, 8 deletions
arkindex/ponos/tests/test_api.py
with
7 additions
and
8 deletions
arkindex/ponos/tests/test_api.py
+
7
−
8
View file @
c6405687
...
@@ -111,19 +111,18 @@ class TestAPI(FixtureAPITestCase):
...
@@ -111,19 +111,18 @@ class TestAPI(FixtureAPITestCase):
resp
=
self
.
client
.
get
(
reverse
(
"
api:task-details
"
,
args
=
[
self
.
task1
.
id
]))
resp
=
self
.
client
.
get
(
reverse
(
"
api:task-details
"
,
args
=
[
self
.
task1
.
id
]))
self
.
assertEqual
(
resp
.
status_code
,
status
.
HTTP_403_FORBIDDEN
)
self
.
assertEqual
(
resp
.
status_code
,
status
.
HTTP_403_FORBIDDEN
)
@expectedFailure
@patch
(
"
arkindex.project.mixins.get_max_level
"
)
def
test_task_details_requires_process_guest
(
self
):
def
test_task_details_requires_process_guest
(
self
,
get_max_level_mock
):
self
.
process
.
creator
=
self
.
superuser
get_max_level_mock
.
return_value
=
None
self
.
process
.
save
()
self
.
corpus
.
memberships
.
filter
(
user
=
self
.
user
).
delete
()
self
.
corpus
.
public
=
False
self
.
corpus
.
save
()
self
.
client
.
force_login
(
self
.
user
)
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
]))
resp
=
self
.
client
.
get
(
reverse
(
"
api:task-details
"
,
args
=
[
self
.
task1
.
id
]))
self
.
assertEqual
(
resp
.
status_code
,
status
.
HTTP_403_FORBIDDEN
)
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
"
)
@patch
(
"
arkindex.project.aws.s3
"
)
def
test_task_details_process_level_corpus
(
self
,
s3_mock
):
def
test_task_details_process_level_corpus
(
self
,
s3_mock
):
s3_mock
.
Object
.
return_value
.
bucket_name
=
"
ponos
"
s3_mock
.
Object
.
return_value
.
bucket_name
=
"
ponos
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment