Commit c9b7e3ca authored by Jérome Perrin's avatar Jérome Perrin

Show duration as timedelta on test results

See merge request !1715
parents 8f76608b ddb29c2e
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="FloatField" module="Products.Formulator.StandardFields"/>
<global name="StringField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
......@@ -18,14 +18,14 @@
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>not_float</string> </key>
<value> <string>You did not enter a floating point number.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -78,11 +78,11 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -93,6 +93,14 @@
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
......@@ -114,7 +122,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -149,11 +159,11 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -164,6 +174,14 @@
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
......@@ -220,12 +238,12 @@
<value> <int>0</int> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value>
<key> <string>input_type</string> </key>
<value> <string>text</string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <int>3</int> </value>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
......@@ -235,6 +253,14 @@
<key> <string>title</string> </key>
<value> <string>Duration</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
......@@ -245,4 +271,17 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: modules[\'datetime\'].timedelta(seconds=context.getProperty(\'duration\'))</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
import datetime
from Products.PythonScripts.standard import Object
return [Object(duration=int(context.getProperty('duration', 0)),
return [Object(duration=datetime.timedelta(seconds=context.getProperty('duration', 0)),
all_tests=context.getProperty('all_tests'),
errors=context.getProperty('errors'),
failures=context.getProperty('failures'),
......
......@@ -83,6 +83,7 @@
<list>
<string>listbox_string_index</string>
<string>listbox_start_date</string>
<string>listbox_duration</string>
</list>
</value>
</item>
......@@ -95,6 +96,7 @@
<string>my_id</string>
<string>my_start_date</string>
<string>my_stop_date</string>
<string>your_real_duration</string>
</list>
</value>
</item>
......
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