def test_childFam_two_invalid(self): child1 = Individual("I1") child2 = Individual("I2") testFam = Family("F1") testFam.childrenObjects = [child1, child2] US28_corresponding_family_entries_error(testFam) self.assertEqual(len(testFam.errors), 2) self.assertEqual(testFam.errors[0], "Corresponding child family not listed for I1") self.assertEqual(testFam.errors[1], "Corresponding child family not listed for I2")
def test_childFam_valid(self): child1 = Individual("I1") child2 = Individual("I2") testFam = Family("F1") child1.childFamilyObject = testFam child2.childFamilyObject = testFam testFam.childrenObjects = [child1, child2] US28_corresponding_family_entries_error(testFam) self.assertEqual(len(testFam.errors), 0) self.assertEqual(testFam.errors, [])