Fix tests

This commit is contained in:
Benbb96 2020-10-08 00:48:03 +02:00
parent bcec57dafe
commit ecc7dcdc17
2 changed files with 8 additions and 4 deletions

View File

@ -75,6 +75,10 @@
{% for d in data %}<tr class='row_{% cycle 'odd' 'even' %}'>
{% for f in d %}<td class='report'>{{ f }}</td>{% endfor %}
</tr>{% endfor %}
{# Total row #}
<tr>
{% for f in total_data %}<td class='report'>{{ f }}</td>{% endfor %}
</tr>
</tbody>
</table>
</div>
@ -96,7 +100,7 @@ Morris.Line({
element: 'chart-content',
data: {% autoescape on %}{{ morrisjs_data|safe }}{% endautoescape %},
xkey: 'x',
ykeys: [{% for d in data|slice:":-1" %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
ykeys: [{% for d in data %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
labels: [{% for n in series_names %}"{{ n }}"{% if not forloop.last %}, {% endif %}{% endfor %}],
xLabels: "month"
});
@ -110,7 +114,7 @@ Morris.Bar({
element: 'chart-content',
data: {% autoescape on %}{{ morrisjs_data|safe }}{% endautoescape %},
xkey: 'x',
ykeys: [{% for d in data|slice:":-1" %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
ykeys: [{% for d in data %}{{ forloop.counter0 }}{% if not forloop.last %}, {% endif %}{% endfor %}],
labels: [{% for n in series_names %}"{{ n }}"{% if not forloop.last %}, {% endif %}{% endfor %}]
});

View File

@ -1339,15 +1339,15 @@ def run_report(request, report):
series_names.append(series[0])
# Add total row to table
total_data = []
total_data = ['Total']
for hdr in possible_options:
total_data.append(str(totals[hdr]))
table.append(['Total'] + total_data)
return render(request, 'helpdesk/report_output.html', {
'title': title,
'charttype': charttype,
'data': table,
'total_data': total_data,
'headings': column_headings,
'series_names': series_names,
'morrisjs_data': morrisjs_data,