Commit 0cd5ddf9 authored by Jérome Perrin's avatar Jérome Perrin

test_result: Fix Result History tab

Now that we are counting test results, we have to make sure that the list
method returns as many lines as the count method, so add some "Not executed"
lines whenever test suite is ran this specific test was not run.
parent f83cf537
......@@ -71,22 +71,33 @@ query_params = {\'creation_date\' : dict(query=context.getCreationDate(), range=
result_list = []\n
expected_id = context.getId()\n
expected_title = context.getTitle()\n
for tr in context.portal_catalog(**query_params):\n
line_found = False\n
tr = tr.getObject()\n
# Optimisation: the test result line probably have the same id in the previous\n
# test result.\n
line = getattr(tr, expected_id, None)\n
if line is not None and line.getTitle() == expected_title \\\n
and line.getSimulationState() in (\'stopped\', \'public_stopped\', \'failed\'):\n
line_found = True\n
for line in tr.contentValues(portal_type=\'Test Result Line\'):\n
if line.getTitle() == context.getTitle() \\\n
and line.getSimulationState() in (\'stopped\', \'public_stopped\', \'failed\'):\n
line_found = True\n
# next time, the test result line will likely have the same id as this one.\n
expected_id = line.getId()\n
# This test result line was not executed in this test. We had a line "Not executed",\n
# mainly because we have a count method that counts test results, so we need to\n
# return as many test result line as the count method returns.\n
if not line_found:\n
return result_list\n
</string> </value>
......@@ -267,7 +267,7 @@
<key> <string>_text</string> </key>
<value> <string>python: cell.getParentValue().getReference()</string> </value>
<value> <string>python: cell.portal_type == \'Test Result\' and cell.getReference() or cell.getParentValue().getReference()</string> </value>
\ No newline at end of file
\ No newline at end of file
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