def test_BothAlive(self): husband = Individual("I9") wife = Individual("I10") testFam = Family("F5") testFam.divorced = True testFam.husbandId = husband.Id testFam.husbandObject = husband testFam.wifeId = wife.Id testFam.wifeObject = wife testFam.divorceDateObject = datetime(2000, 1, 1) US06_check_divorce_before_spouse_death_error(testFam) self.assertEqual(len(testFam.errors), 0) self.assertEqual(testFam.errors, [])
def test_DeadHusband_ValidDate(self): husband = Individual("I1") wife = Individual("I2") testFam = Family("F1") testFam.divorced = True testFam.husbandId = husband.Id testFam.husbandObject = husband testFam.wifeId = wife.Id testFam.wifeObject = wife husband.alive = False husband.deathDateObject = datetime(2000, 1, 1) testFam.divorceDateObject = datetime(1999, 12, 31) US06_check_divorce_before_spouse_death_error(testFam) self.assertEqual(len(testFam.errors), 0) self.assertEqual(testFam.errors, [])
def test_DeadWife_InvalidDate(self): husband = Individual("I7") wife = Individual("I8") testFam = Family("F4") testFam.divorced = True testFam.husbandId = husband.Id testFam.husbandObject = husband testFam.wifeId = wife.Id testFam.wifeObject = wife wife.alive = False wife.deathDateObject = datetime(1999, 12, 31) testFam.divorceDateObject = datetime(2000, 1, 1) US06_check_divorce_before_spouse_death_error(testFam) self.assertEqual(len(testFam.errors), 1) self.assertEqual(testFam.errors[0], "Divorce date is after wife death date")