diff --git a/opentech/apply/funds/tests/factories/models.py b/opentech/apply/funds/tests/factories/models.py index fc9722cc7ccae76c1a29ed81903a0c8240b59f5e..035f04115f6f050f67d6cb8ea6c3036dca65e883 100644 --- a/opentech/apply/funds/tests/factories/models.py +++ b/opentech/apply/funds/tests/factories/models.py @@ -10,6 +10,7 @@ from opentech.apply.funds.models import ( LabType, RequestForPartners, Round, + ScreeningStatus, SealedRound, ) from opentech.apply.funds.models.forms import ( @@ -43,6 +44,7 @@ __all__ = [ 'LabBaseFormFactory', 'LabSubmissionFactory', 'RequestForPartnersFactory', + 'ScreeningStatusFactory', 'SealedRoundFactory', 'SealedSubmissionFactory', 'TodayRoundFactory', @@ -311,3 +313,10 @@ class LabBaseReviewFormFactory(AbstractReviewFormFactory): model = LabBaseReviewForm lab = factory.SubFactory(LabFactory) + + +class ScreeningStatusFactory(factory.DjangoModelFactory): + class Meta: + model = ScreeningStatus + + title = factory.Iterator(["Bad", "Good"]) diff --git a/opentech/apply/funds/tests/test_views.py b/opentech/apply/funds/tests/test_views.py index 2b1cc1c3bb748f1be73dc47e1dda271fb2b0f6ed..6b5dd0a17cce2aac5f3b053cc4c53a2f0089e114 100644 --- a/opentech/apply/funds/tests/test_views.py +++ b/opentech/apply/funds/tests/test_views.py @@ -10,6 +10,7 @@ from opentech.apply.funds.tests.factories import ( LabFactory, LabSubmissionFactory, RoundFactory, + ScreeningStatusFactory, SealedRoundFactory, SealedSubmissionFactory, ) @@ -182,6 +183,12 @@ class TestStaffSubmissionView(BaseSubmissionViewTestCase): response = self.get_page(submission) self.assertNotContains(response, 'Value') + def test_can_screen_submission(self): + screening_outcome = ScreeningStatusFactory() + self.post_page(self.submission, {'form-submitted-screening_form': '', 'screening_status': screening_outcome.id}) + submission = self.refresh(self.submission) + self.assertEqual(submission.screening_status, screening_outcome) + class TestReviewersUpdateView(BaseSubmissionViewTestCase): user_factory = StaffFactory