def test_maternal_obsterical_history_children_died_b4_5yrs_valid(self):
     self.data = {
         'report_datetime': timezone.now(),
         'maternal_visit': self.maternal_visit.id,
         'prev_pregnancies': 1,
         'pregs_24wks_or_more': 1,
         'lost_before_24wks': 0,
         'lost_after_24wks': 0,
         'live_children': 1,
         'children_died_b4_5yrs': 1
     }
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertTrue(mob.is_valid())
 def test_maternal_obsterical_history_children_died_b4_5yrs_valid(self):
     self.data = {
         'report_datetime': timezone.now(),
         'maternal_visit': self.maternal_visit.id,
         'prev_pregnancies': 1,
         'pregs_24wks_or_more': 1,
         'lost_before_24wks': 0,
         'lost_after_24wks': 0,
         'live_children': 1,
         'children_died_b4_5yrs': 1
     }
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertTrue(mob.is_valid())
 def test_maternal_obsterical_history_pregs_24wks_or_more_valid(self):
     self.data['pregs_24wks_or_more'] = 1
     self.data['lost_after_24wks'] = 1
     self.data['children_died_b4_5yrs'] = 1
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertTrue(mob.is_valid())
 def test_maternal_obsterical_history_live_children_valid(self):
     self.data['live_children'] = 2
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertTrue(mob.is_valid())
 def test_maternal_obsterical_history_children_died_b4_5yrs_invalid(self):
     self.data['children_died_b4_5yrs'] = -1
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertFalse(mob.is_valid())
 def test_maternal_obsterical_history_form_valid(self):
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertTrue(mob.is_valid())
 def test_zero_previous_pregnancies(self):
     self.data['prev_pregnancies'] = -1
     self.data['pregs_24wks_or_more'] = 1
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertFalse(mob.is_valid())
 def test_maternal_obsterical_history_pregs_24wks_or_more_valid(self):
     self.data['pregs_24wks_or_more'] = 1
     self.data['lost_after_24wks'] = 1
     self.data['children_died_b4_5yrs'] = 1
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertTrue(mob.is_valid())
 def test_maternal_obsterical_history_live_children_valid(self):
     self.data['live_children'] = 2
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertTrue(mob.is_valid())
 def test_maternal_obsterical_history_children_died_b4_5yrs_invalid(self):
     self.data['children_died_b4_5yrs'] = -1
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertFalse(mob.is_valid())
 def test_maternal_obsterical_history_form_valid(self):
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertTrue(mob.is_valid())
 def test_zero_previous_pregnancies(self):
     self.data['prev_pregnancies'] = -1
     self.data['pregs_24wks_or_more'] = 1
     mob = MaternalObstericalHistoryForm(data=self.data)
     self.assertFalse(mob.is_valid())