def test_start_date_after_signed_date(self):
     """Start date after agreement start date is invalid
     If not contingency_pd, and certain document_type
     """
     agreement = AgreementFactory()
     intervention = InterventionFactory(
         agreement=agreement,
         signed_pd_document="random.pdf",
         start=datetime.date.today() + datetime.timedelta(days=2),
         contingency_pd=False,
         document_type=Intervention.PD,
     )
     self.assertTrue(start_date_related_agreement_valid(intervention))
 def test_start_date_after_signed_date(self):
     """Start date after agreement start date is invalid
     If not contingency_pd, and certain document_type
     """
     agreement = AgreementFactory()
     intervention = InterventionFactory(
         agreement=agreement,
         signed_pd_document="random.pdf",
         start=datetime.date.today() + datetime.timedelta(days=2),
         contingency_pd=False,
         document_type=Intervention.PD,
     )
     self.assertTrue(start_date_related_agreement_valid(intervention))
 def test_start_date_before_agreement_start(self):
     """Start date before agreement start date is invalid
     If not contingency_pd, and certain document_type
     """
     agreement = AgreementFactory(start=datetime.date(2002, 1, 1))
     for document_type in [Intervention.PD, Intervention.SHPD]:
         intervention = InterventionFactory(
             agreement=agreement,
             signed_pd_document="random.pdf",
             start=datetime.date(2001, 1, 1),
             contingency_pd=False,
             document_type=document_type,
         )
         self.assertFalse(start_date_related_agreement_valid(intervention))
 def test_start_date_before_agreement_start(self):
     """Start date before agreement start date is invalid
     If not contingency_pd, and certain document_type
     """
     agreement = AgreementFactory(
         start=datetime.date(2002, 1, 1)
     )
     for document_type in [Intervention.PD, Intervention.SHPD]:
         intervention = InterventionFactory(
             agreement=agreement,
             signed_pd_document="random.pdf",
             start=datetime.date(2001, 1, 1),
             contingency_pd=False,
             document_type=document_type,
         )
         self.assertFalse(start_date_related_agreement_valid(intervention))