# HG changeset patch # User Sylvain Thénault # Date 1295892582 -3600 # Node ID 6fa712e9dfa5e7b434aac24e0a275b8a452ecbf1 # Parent 1538542a88ed7976c082d83b7f2dde99dd6dbf0f [testlib] missing method on value generator to generate the Interval type diff -r 1538542a88ed -r 6fa712e9dfa5 devtools/fill.py --- a/devtools/fill.py Mon Jan 24 19:09:14 2011 +0100 +++ b/devtools/fill.py Mon Jan 24 19:09:42 2011 +0100 @@ -157,6 +157,11 @@ base = date(randint(2000, 2010), 1, 1) + timedelta(randint(1, 365)) return self._constrained_generate(entity, attrname, base, timedelta(days=1), index) + def generate_interval(self, entity, attrname, index): + """generates a random date (format is 'yyyy-mm-dd')""" + base = timedelta(randint(1, 365)) + return self._constrained_generate(entity, attrname, base, timedelta(days=1), index) + def generate_time(self, entity, attrname, index): """generates a random time (format is ' HH:MM')""" return time(11, index%60) #'11:%02d' % (index % 60)