[view] checkresults tabs and summary are now ordered by creation_date order
authorPaul Tonelli <paul.tonelli@logilab.fr>
Fri, 25 Apr 2014 14:50:06 +0200
changeset 1431 b5c8a94aba19
parent 1430 de746677fb1e
child 1432 71952d5c0bfd
[view] checkresults tabs and summary are now ordered by creation_date order Closes #2923618
views/testexecution.py
--- a/views/testexecution.py	Tue Aug 20 10:22:39 2013 +0200
+++ b/views/testexecution.py	Fri Apr 25 14:50:06 2014 +0200
@@ -179,7 +179,8 @@
     def tabs(self):
         tabs = ['apycot.te.tab_setup']
         entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
-        for check in entity.reverse_during_execution:#configuration.all_checks:
+        for check in sorted(entity.reverse_during_execution,
+                key=lambda checkresult: checkresult.creation_date):
             label = u'%s [<b class="status_%s">%s</b>]' % (
                 xml_escape(check.name), check.status, self._cw._(check.status))
             tabs.append((check.anchored_name,
@@ -260,7 +261,8 @@
     def cell_call(self, row, col):
         entity = self.cw_rset.get_entity(row, col)
         checks = []
-        for check in entity.reverse_during_execution:
+        for check in sorted(entity.reverse_during_execution,
+                key=lambda checkresult: checkresult.creation_date):
             content = u'%s (%s)' % (self._cw._(check.name), check.status)
             url = check.absolute_url()
             title = self._cw._('see execution report for %s') % check.name