def test_on_haart_2(self): """Assert that if mother was not supposed to take HAART, then cannot provide a reason for taking HAART""" self.data['on_arv_reason'] = 'pmtct bf' form = MaternalArvPostForm(data=self.data) errors = ''.join(form.errors.get('__all__')) self.assertIn( 'You indicated that participant was not on HAART. You CANNOT provide a reason.', errors)
def test_on_haart_1(self): """Assert that if mother was supposed to take HAART, then reason for haart cannot be N/A""" self.data['on_arv_since'] = YES form = MaternalArvPostForm(data=self.data) errors = ''.join(form.errors.get('__all__')) self.assertIn("You indicated that participant was on triple ARVs. Reason CANNOT be" " 'Not Applicable'. ", errors)
def test_on_haart_4(self): """Assert that if mother was supposed to take HAART, and reason for HAART given is valid""" self.data['on_arv_since'] = YES self.data['on_arv_reason'] = 'pmtct bf' form = MaternalArvPostForm(data=self.data) self.assertTrue(form.is_valid())
def test_on_haart_3(self): """Assert that mother was not supposed to take HAART and no reason for taking HAART is provided then valid""" form = MaternalArvPostForm(data=self.data) self.assertTrue(form.is_valid())