Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
90b593c2
Commit
90b593c2
authored
6 years ago
by
Erin Mullaney
Browse files
Options
Downloads
Patches
Plain Diff
#960 test updates
parent
a09c7e3b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
opentech/apply/review/tests/test_views.py
+12
-3
12 additions, 3 deletions
opentech/apply/review/tests/test_views.py
with
12 additions
and
3 deletions
opentech/apply/review/tests/test_views.py
+
12
−
3
View file @
90b593c2
from
django.urls
import
reverse
from
opentech.apply.activity.models
import
Activity
from
opentech.apply.funds.tests.factories.models
import
ApplicationSubmissionFactory
from
opentech.apply.users.tests.factories
import
StaffFactory
,
UserFactory
from
opentech.apply.utils.testing.tests
import
BaseViewTestCase
from
.factories
import
ReviewFactory
,
ReviewFormFieldsFactory
,
ReviewFormFactory
from
..models
import
Review
from
..options
import
NA
from
..models
import
Review
,
ReviewOpinion
from
..options
import
NA
,
AGREE
class
StaffReviewsTestCase
(
BaseViewTestCase
):
...
...
@@ -221,7 +222,7 @@ class StaffReviewOpinionCase(BaseViewTestCase):
def
get_kwargs
(
self
,
instance
):
return
{
'
pk
'
:
instance
.
id
,
'
submission_pk
'
:
instance
.
submission
.
id
}
def
test_can_see_opinion_buttons_on_
an
other
_reviewer
s_review
(
self
):
def
test_can_see_opinion_buttons_on_others_review
(
self
):
staff
=
StaffFactory
()
review
=
ReviewFactory
(
submission
=
self
.
submission
,
author
=
staff
,
recommendation_yes
=
True
)
response
=
self
.
get_page
(
review
)
...
...
@@ -233,3 +234,11 @@ class StaffReviewOpinionCase(BaseViewTestCase):
response
=
self
.
get_page
(
review
)
self
.
assertNotContains
(
response
,
'
<button name=
"
opinion
"'
)
self
.
assertNotIn
(
'
opinion_choices
'
,
response
.
context_data
)
def
test_can_add_opinion_to_others_review
(
self
):
staff
=
StaffFactory
()
review
=
ReviewFactory
(
submission
=
self
.
submission
,
author
=
staff
,
recommendation_yes
=
True
)
self
.
post_page
(
review
,
{
'
opinion
'
:
AGREE
})
self
.
assertTrue
(
'
agrees
'
in
Activity
.
objects
.
first
().
message
)
self
.
assertEqual
(
ReviewOpinion
.
objects
.
all
().
count
(),
1
)
self
.
assertEqual
(
ReviewOpinion
.
objects
.
first
().
opinion
,
AGREE
)
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