Commit 40a82031 authored by Jérome Perrin's avatar Jérome Perrin

test_result: fix display of durations

 - str() because in ERP5JS the duration are directly serialized to json,
   which is not allowed.
 - int() to have a second level precision, which is more readable.
parent 306aa82c
Pipeline #34308 failed with stage
in 0 seconds
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: modules[\'datetime\'].timedelta(seconds=context.getProperty(\'duration\'))</string> </value> <value> <string>python: str(modules[\'datetime\'].timedelta(seconds=int(context.getProperty(\'duration\'))))</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
import datetime import datetime
from Products.PythonScripts.standard import Object from Products.PythonScripts.standard import Object
return [Object(duration=datetime.timedelta(seconds=context.getProperty('duration', 0)), return [Object(duration=str(datetime.timedelta(seconds=int(context.getProperty('duration', 0)))),
all_tests=context.getProperty('all_tests'), all_tests=context.getProperty('all_tests'),
errors=context.getProperty('errors'), errors=context.getProperty('errors'),
failures=context.getProperty('failures'), failures=context.getProperty('failures'),
......
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: modules[\'datetime\'].timedelta(seconds=cell.getProperty(\'duration\'))</string> </value> <value> <string>python: str(modules[\'datetime\'].timedelta(seconds=int(cell.getProperty(\'duration\'))))</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment