Example #1
0
 def test_can_access_determination(self):
     submission = ApplicationSubmissionFactory(status='in_discussion')
     determination = DeterminationFactory(submission=submission,
                                          author=self.user,
                                          submitted=True)
     response = self.get_page(determination)
     self.assertContains(response, determination.submission.title)
     self.assertContains(response, self.user.full_name)
     self.assertContains(response, submission.get_absolute_url())
Example #2
0
 def test_can_edit_draft_determination_if_not_lead_with_projects(self):
     submission = ApplicationSubmissionFactory(status='in_discussion')
     determination = DeterminationFactory(submission=submission,
                                          author=self.user,
                                          accepted=True)
     response = self.post_page(submission, {
         'data': 'value',
         'outcome': determination.outcome
     }, 'form')
     self.assertContains(response, 'Approved')
     self.assertRedirects(response,
                          self.absolute_url(submission.get_absolute_url()))
Example #3
0
 def test_cant_resubmit_determination(self):
     submission = ApplicationSubmissionFactory(status='in_discussion',
                                               lead=self.user)
     determination = DeterminationFactory(submission=submission,
                                          author=self.user,
                                          accepted=True,
                                          submitted=True)
     response = self.post_page(submission, {
         'data': 'value',
         'outcome': determination.outcome
     }, 'form')
     self.assertRedirects(response,
                          self.absolute_url(submission.get_absolute_url()))
Example #4
0
 def test_cant_access_wrong_status(self):
     submission = ApplicationSubmissionFactory(status='rejected')
     response = self.get_page(submission, 'form')
     self.assertRedirects(response,
                          self.absolute_url(submission.get_absolute_url()))
Example #5
0
 def test_can_access_form_if_lead(self):
     submission = ApplicationSubmissionFactory(status='in_discussion',
                                               lead=self.user)
     response = self.get_page(submission, 'form')
     self.assertContains(response, submission.title)
     self.assertContains(response, submission.get_absolute_url())