-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temp/embargo and tests wip #835
Changes from 5 commits
12e4991
c66e841
c83f108
38947e0
c793bf9
31ac676
54360ab
790b5d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
from django.test import TestCase | ||
|
||
from main.tests import BaseViewTestCase | ||
from proposals.models import Proposal, Relation | ||
from proposals.models import Proposal, Relation, Wmo | ||
from reviews.models import Review | ||
|
||
from proposals.views.proposal_views import ( | ||
|
@@ -77,6 +77,12 @@ def setup_proposal(self): | |
Please note, this currently uses a mish-mash of both fixtures | ||
and programmatically created users and objects. | ||
""" | ||
self.wmo = Wmo( | ||
status=0, | ||
metc="N", | ||
is_medical="N", | ||
) | ||
self.wmo.save() | ||
Comment on lines
+80
to
+85
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This wmo must be implicitly getting used for the regular def setup_proposal(self):
"""
Load our test proposals from a fixture, then add our user as
an applicant to each of them.
Please note, this currently uses a mish-mash of both fixtures
and programmatically created users and objects.
"""
self.wmo = Wmo(
status=0,
metc="N",
is_medical="N",
)
self.wmo.save()
self.proposal = Proposal.objects.get(pk=1)
self.proposal.applicants.add(self.user)
self.proposal.wmo = self.wmo
self.proposal.save() Right before the proposal gets saved. Just to make it explicit and less magic. |
||
self.proposal = Proposal.objects.get(pk=1) | ||
self.proposal.applicants.add(self.user) | ||
self.proposal.save() | ||
|
@@ -156,6 +162,7 @@ def test_submission_unsupervised(self): | |
self.get_post_data(), | ||
user=self.user, | ||
) | ||
|
||
self.assertIn(page.status_code, [302, 200]) | ||
self.refresh() | ||
# Post-submission tests | ||
|
@@ -225,6 +232,13 @@ class PreassessmentSubmitTestCase( | |
def setUp(self): | ||
super().setUp() | ||
self.proposal = self.pre_assessment | ||
wmo = Wmo( | ||
status=0, | ||
metc="N", | ||
is_medical="N", | ||
) | ||
wmo.save() | ||
self.proposal.wmo = wmo | ||
|
||
|
||
class PreapprovedSubmitTestCase( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I intended to add a comment along the lines of
"we save this variable for later, but want it set for None for this part of the validation"
Because as it stands this is kind of confusing.