=== modified file 'dashboard_app/helpers.py'
@@ -427,13 +427,13 @@
"""
Import TestCase
"""
- id_units = []
+ id_units = {}
for c_test_result in c_test_results:
if "test_case_id" not in c_test_result:
continue
- id_units.append(
- (c_test_result["test_case_id"],
- c_test_result.get("units", "")))
+ id_units.setdefault(
+ c_test_result["test_case_id"], c_test_result.get("units", ""))
+ id_units = id_units.items()
cursor = connection.cursor()
for i in range(0, len(id_units), 1000):
=== modified file 'dashboard_app/tests/other/deserialization.py'
@@ -259,7 +259,7 @@
class BundleDeserializerSuccessTests(TestCaseWithScenarios):
- json_text = """
+ json_text = '''
{
"format": "Dashboard Bundle Format 1.0",
"test_runs": [
@@ -268,7 +268,8 @@
"analyzer_assigned_uuid": "1ab86b36-c23d-11df-a81b-002163936223",
"analyzer_assigned_date": "2010-12-31T23:59:59Z",
"time_check_performed": true,
- "test_results": [{
+ "test_results": [
+ {
"test_case_id": "some_test_case_id",
"result": "unknown",
"measurement": 1000.3,
@@ -282,10 +283,16 @@
"attr1": "value1",
"attr2": "value2"
}
- }],
+ },
+ {
+ "test_case_id": "some_test_case_id",
+ "result": "unknown"
+ }
+ ],
"sw_context": {
"packages": [
{"name": "pkg1", "version": "1.0"},
+ {"name": "pkg1", "version": "1.0"},
{"name": "pkg2", "version": "0.5"}
],
"sw_image": {
@@ -321,7 +328,7 @@
}
]
}
- """
+ '''
scenarios = [
('with_evolution', {