コード例 #1
0
 def test_uses_contraceptive_no(self):
     self.data['more_children'] = YES
     self.data['uses_contraceptive'] = NO
     form = ReproductiveHealthForm(data=self.data)
     self.assertIn(
         'Participant does not use a contraceptive method, no need to give a contraceptive method',
         form.errors.get('__all__'))
コード例 #2
0
 def test_uses_contraceptive_yes(self):
     self.data['more_children'] = YES
     self.data['uses_contraceptive'] = YES
     self.data['contr'] = None
     form = ReproductiveHealthForm(data=self.data)
     self.assertIn(
         'Participant uses a contraceptive method, please select a valid method',
         form.errors.get('__all__'))
コード例 #3
0
 def test_next_none(self):
     self.data['more_children'] = YES
     self.data['next_child'] = None
     self.data['contraceptive_measure'] = YES
     form = ReproductiveHealthForm(data=self.data)
     self.assertIn(
         'Participant desires more children, question on next child cannot be None.',
         form.errors.get('__all__'))
コード例 #4
0
 def test_more_children(self):
     self.data['more_children'] = NO
     self.data['next_child'] = 'between 2-5years from now'
     form = ReproductiveHealthForm(data=self.data)
     self.assertIn(
         'You said the client does not desire more children please do not answer '
         'When would you like to have your next child?',
         form.errors.get('__all__'))
コード例 #5
0
 def test_pap_smear_date_estimate(self):
     self.data['pap_smear'] = YES
     self.data['pap_smear_date'] = date.today()
     self.data['pap_smear_estimate'] = None
     form = ReproductiveHealthForm(data=self.data)
     self.assertIn(
         'Pap smear date has been provided, please let us know if this date has been estimated.',
         form.errors.get('__all__'))
コード例 #6
0
 def test_pap_smear_result_yes(self):
     self.data['pap_smear'] = YES
     self.data['pap_smear_date'] = date.today()
     self.data['pap_smear_result'] = YES
     self.data['pap_smear_result_status'] = None
     form = ReproductiveHealthForm(data=self.data)
     self.assertIn(
         'Participant knows her pap smear result, please give the status of the pap smear.',
         form.errors.get('__all__'))
コード例 #7
0
 def test_pap_smear_result_no(self):
     self.data['pap_smear'] = YES
     self.data['pap_smear_date'] = date.today()
     self.data['pap_smear_result'] = NO
     self.data['pap_smear_result_status'] = 'abnormal'
     self.data['pap_smear_result_abnormal'] = 'Yeast Infection'
     form = ReproductiveHealthForm(data=self.data)
     self.assertIn(
         'Participant pap smear result not known, no need to give pap smear status or notification date.',
         form.errors.get('__all__'))
コード例 #8
0
 def test_pap_smear_no(self):
     self.data['pap_smear'] = NO
     self.data['pap_smear_date'] = date.today()
     form = ReproductiveHealthForm(data=self.data)
     self.assertIn('Pap smear date not known, please do not add it.',
                   form.errors.get('__all__'))
コード例 #9
0
 def test_pap_smear_yes(self):
     self.data['pap_smear'] = YES
     self.data['pap_smear_date'] = None
     form = ReproductiveHealthForm(data=self.data)
     self.assertIn('Please give the date the pap smear was done.',
                   form.errors.get('__all__'))