Exemplo n.º 1
0
 def test_advised_stop_bf_3(self):
     """Assert that if mother has not been breast-feeding then advised_stop_bf CANT be YES"""
     self.data['breast_feeding'] = NO
     self.data['advised_stop_bf'] = YES
     form = MaternalBreastHealthForm(data=self.data)
     errors = ''.join(form.errors.get('__all__'))
     self.assertIn(
         'You indicated that the mother has not been breast feeding, question on whether'
         ' she was advised to stop breast feeding should be Not Applicable.',
         errors)
Exemplo n.º 2
0
 def test_mastitis_2(self):
     """Assert that if mother does not have mastitis, then cannot indicate where"""
     self.data['breast_feeding'] = YES
     self.data['has_mastitis'] = NO
     self.data['mastitis'] = 'right breast'
     self.data['has_lesions'] = NO
     form = MaternalBreastHealthForm(data=self.data)
     errors = ''.join(form.errors.get('__all__'))
     self.assertIn(
         'You stated that mother did not have mastitis, yet indicated '
         'where mother if affected. Please correct.', errors)
Exemplo n.º 3
0
 def test_advised_stop_bf(self):
     """Assert that if the mother was advised_stop_bf is NO then give a reason for why_not_advised"""
     self.data['breast_feeding'] = YES
     self.data['has_mastitis'] = NO
     self.data['has_lesions'] = NO
     self.data['advised_stop_bf'] = NO
     self.data['why_not_advised'] = None
     form = MaternalBreastHealthForm(data=self.data)
     errors = ''.join(form.errors.get('__all__'))
     self.assertIn(
         'You answered No to Was the mother advised to discontinue breastfeeding, '
         'please provide a reason why.', errors)
Exemplo n.º 4
0
 def test_advised_stop_bf_4(self):
     """Assert that if mother has not been breast-feeding then advised_stop_bf CANT be YES"""
     self.data['breast_feeding'] = YES
     self.data['has_mastitis'] = NO
     self.data['has_lesions'] = NO
     self.data['advised_stop_bf'] = NOT_APPLICABLE
     form = MaternalBreastHealthForm(data=self.data)
     errors = ''.join(form.errors.get('__all__'))
     self.assertIn(
         'You indicated that the mother has been breast feeding, question on '
         'whether she was advised to stop breast feeding CANNOT be Not Applicable.',
         errors)
Exemplo n.º 5
0
 def test_advised_stop_bf_2(self):
     """Assert that if has_lesions is YES then advised_stop_bf CANT be NOT_APPLICABLE"""
     self.data['breast_feeding'] = YES
     self.data['has_mastitis'] = NO
     self.data['has_lesions'] = YES
     self.data['lesions'] = 'right breast'
     form = MaternalBreastHealthForm(data=self.data)
     errors = ''.join(form.errors.get('__all__'))
     self.assertIn(
         'You indicated that participant has mastitis or has lesions. Was '
         'participant advised to stop breast feeding CANNOT be Not Applicable or NO.',
         errors)