diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 95e0a2adb..8563bf8dc 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,6 +1,6 @@ 2006-09-12 Alex Roitman * src/plugins/TestcaseGenerator.py (fill_object): Use integer - confidence level. + confidence level; (generate_date_tests): Remove invalid dates. * src/DateHandler/_Date_fr.py (DateParserFR.init_strings): Typo. * src/const.py.in (app_gramps): Revert to using a string. diff --git a/gramps2/src/plugins/TestcaseGenerator.py b/gramps2/src/plugins/TestcaseGenerator.py index 21a034b24..ecb996212 100644 --- a/gramps2/src/plugins/TestcaseGenerator.py +++ b/gramps2/src/plugins/TestcaseGenerator.py @@ -648,51 +648,51 @@ class TestcaseGenerator(Tool.Tool): "This is a textual date") dates.append( d) - # test invalid dates - dateval = (4,7,1789,False,5,8,1876,False) - for l in range(1,len(dateval)): - d = RelLib.Date() - try: - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, - RelLib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") - dates.append( d) - except Errors.DateError, e: - d.set_as_text("Date identified value correctly as invalid.\n%s" % e) - dates.append( d) - except: - d = RelLib.Date() - d.set_as_text("Date.set Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) - dates.append( d) - for l in range(1,len(dateval)): - d = RelLib.Date() - try: - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN,RelLib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") - dates.append( d) - except Errors.DateError, e: - d.set_as_text("Date identified value correctly as invalid.\n%s" % e) - dates.append( d) - except: - d = RelLib.Date() - d.set_as_text("Date.set Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) - dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, - RelLib.Date.CAL_GREGORIAN,(44,7,1789,False),"Text comment") - dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, - RelLib.Date.CAL_GREGORIAN,(4,77,1789,False),"Text comment") - dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN, - RelLib.Date.CAL_GREGORIAN, - (4,7,1789,False,55,8,1876,False),"Text comment") - dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN, - RelLib.Date.CAL_GREGORIAN, - (4,7,1789,False,5,88,1876,False),"Text comment") - dates.append( d) +## # test invalid dates +## dateval = (4,7,1789,False,5,8,1876,False) +## for l in range(1,len(dateval)): +## d = RelLib.Date() +## try: +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, +## RelLib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") +## dates.append( d) +## except Errors.DateError, e: +## d.set_as_text("Date identified value correctly as invalid.\n%s" % e) +## dates.append( d) +## except: +## d = RelLib.Date() +## d.set_as_text("Date.set Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) +## dates.append( d) +## for l in range(1,len(dateval)): +## d = RelLib.Date() +## try: +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN,RelLib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") +## dates.append( d) +## except Errors.DateError, e: +## d.set_as_text("Date identified value correctly as invalid.\n%s" % e) +## dates.append( d) +## except: +## d = RelLib.Date() +## d.set_as_text("Date.set Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) +## dates.append( d) +## d = RelLib.Date() +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, +## RelLib.Date.CAL_GREGORIAN,(44,7,1789,False),"Text comment") +## dates.append( d) +## d = RelLib.Date() +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, +## RelLib.Date.CAL_GREGORIAN,(4,77,1789,False),"Text comment") +## dates.append( d) +## d = RelLib.Date() +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN, +## RelLib.Date.CAL_GREGORIAN, +## (4,7,1789,False,55,8,1876,False),"Text comment") +## dates.append( d) +## d = RelLib.Date() +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN, +## RelLib.Date.CAL_GREGORIAN, +## (4,7,1789,False,5,88,1876,False),"Text comment") +## dates.append( d) # now add them as birth to new persons for dateval in dates: