def test_has_cd4_5(self):
     """If has CD4 is indicated as Yes, then CD4 count date and result should be provided."""
     self.data['has_cd4'] = YES
     self.data['cd4_date'] = timezone.now() - timezone.timedelta(days=2)
     self.data['cd4_result'] = 600
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertTrue(form.is_valid())
 def test_has_vl_7(self):
     """If has VL  is YES, the both VL date and result should be provided"""
     self.data['has_vl'] = YES
     self.data['vl_date'] = timezone.now() - timezone.timedelta(days=2)
     self.data['vl_detectable'] = YES
     self.data['vl_result'] = 1389
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertTrue(form.is_valid())
 def test_has_vl_4(self):
     """If has VL is indicated as NO, then VL result should not be provided."""
     self.data['has_vl'] = NO
     self.data['vl_result'] = 899
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertIn('You indicated that a VL count was NOT performed, yet provided a VL result'
                   ' Please correct.', form.errors.get('__all__'))
 def test_has_vl_3(self):
     """If has VL is indicated as NO, then VL date should not be provided."""
     self.data['has_vl'] = NO
     self.data['vl_date'] = timezone.now() - timezone.timedelta(days=2)
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertIn('You indicated that a VL count was NOT performed, yet provided a date VL '
                   'was performed. Please correct.', form.errors.get('__all__'))
 def test_has_vl_and_detectable(self):
     """If has VL is indicated as yes, was it detectable."""
     self.data['has_vl'] = YES
     self.data['vl_date'] = timezone.now() - timezone.timedelta(days=2)
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertIn('You stated that a VL count was performed. Please indicate if it was detectable.',
                   form.errors.get('__all__'))
 def test_has_cd4_4(self):
     """If has CD4 is indicated as no, then CD4 count result should be NOT provided."""
     self.data['has_cd4'] = NO
     self.data['cd4_result'] = 600
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertIn('You indicated that a CD4 count was NOT performed, yet provided a CD4 '
                   'result. Please correct.', form.errors.get('__all__'))
 def test_has_cd4_3(self):
     """If has CD4 is indicated as no, then CD4 count date should be NOT provided."""
     self.data['has_cd4'] = NO
     self.data['cd4_date'] = timezone.now() - timezone.timedelta(days=2)
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertIn('You indicated that a CD4 count was NOT performed, yet provided a date '
                   'CD4 was performed. Please correct.', form.errors.get('__all__'))
 def test_has_cd4_2(self):
     """If has CD4 is indicated as yes, then CD4 count  result should be provided."""
     self.data['has_cd4'] = YES
     self.data['cd4_date'] = timezone.now() - timezone.timedelta(days=2)
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertIn('You indicated that a CD4 count was performed. Please provide the result.',
                   form.errors.get('__all__'))
 def test_has_vl_8(self):
     self.data['has_vl'] = NO
     self.data['vl_detectable'] = YES
     form = MaternalLabDelClinicForm(data=self.data)
     errors = ''.join(form.errors.get('__all__'))
     self.assertIn(
         'You stated that a VL count was NOT performed, you CANNOT indicate if VL was detectable.',
         errors)
 def test_has_vl_6(self):
     self.data['has_vl'] = YES
     self.data['vl_date'] = timezone.now() - timezone.timedelta(days=2)
     self.data['vl_result'] = 1389
     form = MaternalLabDelClinicForm(data=self.data)
     errors = ''.join(form.errors.get('__all__'))
     self.assertIn(
         'You stated that a VL count was performed. Please indicate if it was detectable.', errors)
 def test_detectable_vl_for_result(self):
     """If has VL is indicated as yes, and is detectable, what is the result"""
     self.data['has_vl'] = YES
     self.data['vl_date'] = timezone.now() - timezone.timedelta(days=2)
     self.data['vl_detectable'] = YES
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertIn('You indicated that the VL was detectable. Provide provide VL result.',
                   form.errors.get('__all__'))
 def test_has_vl_5(self):
     """If has vl is No then VL date and result shot NOT be provided"""
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertTrue(form.is_valid())
 def test_has_vl_1(self):
     """If has VL is indicated as yes, then date VL was performed should be provided."""
     self.data['has_vl'] = YES
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertIn('You indicated that a VL count was performed. Please provide the date.',
                   form.errors.get('__all__'))
 def test_has_cd4_6(self):
     """If has CD4 is indicated as NO, then CD4 count date and result should be  NOT provided."""
     form = MaternalLabDelClinicForm(data=self.data)
     self.assertTrue(form.is_valid())