Exemplo n.º 1
0
 def test_validate_vitamin_a_vaccine(self):
     """Test for Vitamin A vaccine administered earlier than 6 months"""
     self.data['received_vaccine_name'] = 'Vitamin_A'
     self.data['infant_age'] = '2'
     self.data['date_given'] = date.today()
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "Vitamin A is given to children between 6-11 months of"
         " life", form.errors.get('__all__'))
Exemplo n.º 2
0
 def test_validate_measles_vaccine(self):
     """Test measles vaccine administered to an infant who is only a month old"""
     self.data['received_vaccine_name'] = 'Measles'
     self.data['infant_age'] = '2'
     self.data['date_given'] = date.today()
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "Measles vaccine is only administered at 9 or 18"
         " months of infant life.", form.errors.get('__all__'))
Exemplo n.º 3
0
 def test_pentavalent_vaccine(self):
     """Test for Pentavalent vaccine administered at 6-11 months of infant life"""
     self.data['received_vaccine_name'] = 'Pentavalent'
     self.data['infant_age'] = '6-11'
     self.data['date_given'] = date.today()
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "The Pentavalent vaccine can only be administered at 2 or 3 or"
         " 4 months of infant life.", form.errors.get('__all__'))
Exemplo n.º 4
0
 def test_polio_vaccine(self):
     """Test that polio vaccine is administered at correct age"""
     self.data['received_vaccine_name'] = 'Polio'
     self.data['infant_age'] = '6-11'
     self.data['date_given'] = date.today()
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "Polio vaccine can only be administered at 2 or 3 or 4 or 18 "
         "months of infant life", form.errors.get('__all__'))
Exemplo n.º 5
0
 def test_rotavirus_vaccine(self):
     """Test rotavirus administered to infant at age 4months"""
     self.data['received_vaccine_name'] = 'Rotavirus'
     self.data['infant_age'] = '4'
     self.data['date_given'] = date.today()
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "Rotavirus is only administered at 2 or 3 months of"
         " infant life", form.errors.get('__all__'))
Exemplo n.º 6
0
 def test_pcv_vaccine(self):
     """Test that PCV is administered at correct age"""
     self.data['received_vaccine_name'] = 'PCV_Vaccine'
     self.data['infant_age'] = '6-11'
     self.data['date_given'] = date.today()
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "The PCV [Pneumonia Conjugated Vaccine], can ONLY be administered at"
         " 2 or 3 or 4 months of infant life.", form.errors.get('__all__'))
Exemplo n.º 7
0
 def test_haemophilus_vaccine(self):
     """Test that haemophilus influenza vaccine is not administered at inappropiate infant age"""
     self.data['received_vaccine_name'] = 'Haemophilus_influenza'
     self.data['infant_age'] = '6-11'
     self.data['date_given'] = date.today()
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "Haemophilus Influenza B vaccine can only be given at 2 or 3 or"
         " 4 months of infant life.", form.errors.get('__all__'))
Exemplo n.º 8
0
 def test_dpt_vaccine(self):
     """Test that DPT vaccine is not given at inappropriate infant age"""
     self.data['received_vaccine_name'] = 'DPT'
     self.data['infant_age'] = '6-11'
     self.data['date_given'] = date.today()
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "DPT. Diphtheria, Pertussis and Tetanus can only be admistered at"
         " 2 or 3 or 4 months ONLY.", form.errors.get('__all__'))
Exemplo n.º 9
0
 def test_hepatitis_vaccine(self):
     """Test that the hepatitis vaccine is not given at inappropriate infant age"""
     self.data['received_vaccine_name'] = 'Hepatitis_B'
     self.data['infant_age'] = '6-11'
     self.data['date_given'] = date.today()
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "Hepatitis B can only be administered at birth or 2 or 3 or 4 "
         "months of infant life", form.errors.get('__all__'))
Exemplo n.º 10
0
 def test_vaccination_at_birth(self):
     """Test that the correct vaccine is given at birth or few days after birth"""
     self.data['received_vaccine_name'] = 'BCG'
     self.data['infant_age'] = '2'
     self.data['date_given'] = date.today()
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "BCG vaccination is ONLY given at birth or few days after birth",
         form.errors.get('__all__'))
Exemplo n.º 11
0
 def test_received_vaccine_fields(self):
     """Test that when a receive vaccine name is filled that a date is provided"""
     self.data['received_vaccine_name'] = 'BCG'
     self.data['date_given'] = ''
     self.data['infant_age'] = '2'
     form = VaccinesReceivedForm(data=self.data)
     self.assertIn(
         "You provided a vaccine name {}. What date was it given to the "
         "infant?".format(self.data['received_vaccine_name']),
         form.errors.get('__all__'))