[IMP] yaml_import: enforce ISO date format for date[time] fields in yml tests, to execute locale-agnostic tests
bzr revid: odo@openerp.com-20100916144644-thsb8624du8ik6rn
This commit is contained in:
@@ -374,6 +374,14 @@ class YamlInterpreter(object):
|
||||
elif column._type == "many2many":
|
||||
ids = [self.get_id(xml_id) for xml_id in expression]
|
||||
value = [(6, 0, ids)]
|
||||
elif column._type == "date":
|
||||
# enforce ISO format for date values, to be locale-agnostic during tests
|
||||
time.strptime(expression, "%Y-%m-%d")
|
||||
value = expression
|
||||
elif column._type == "datetime":
|
||||
# enforce ISO format for date values, to be locale-agnostic during tests
|
||||
time.strptime(expression, "%Y-%m-%d %H:%M:%S")
|
||||
value = expression
|
||||
else: # scalar field
|
||||
if is_eval(expression):
|
||||
value = self.process_eval(expression)
|
||||
|
||||
Reference in New Issue
Block a user