File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -106,8 +106,6 @@ def __init__(self):
106106 'failure' : 0 ,
107107 'log' : [],
108108 }
109- if not test_methods :
110- raise Exception ("A report must contain at least one test method." )
111109 self .test_methods = test_methods
112110
113111 @classproperty
Original file line number Diff line number Diff line change 1212 {% csrf_token %}
1313 {% render_form form %}
1414 < div class ="float-end ">
15- < button type ="submit " name ="_run " class ="btn btn-primary ">
15+ < button type ="submit " name ="_run " class ="btn btn-primary "
16+ {% if not report.test_methods|length %}
17+ disabled
18+ {% endif %}
19+ >
1620 {% if report.result %}
1721 < i class ="mdi mdi-replay "> </ i > {% trans "Run Again" %}
1822 {% else %}
Original file line number Diff line number Diff line change @@ -68,10 +68,16 @@ <h5 class="card-header" id="module{{ module.pk }}">
6868 </ td >
6969 {% else %}
7070 < td class ="text-muted "> {% trans "Never" %}</ td >
71- < td > {{ ''|placeholder }}</ td >
71+ {% if report.test_methods|length %}
72+ < td > {{ ''|placeholder }}</ td >
73+ {% else %}
74+ < td >
75+ Invalid (no test methods found)
76+ </ td >
77+ {% endif %}
7278 {% endif %}
7379 < td >
74- {% if perms.extras.run_report %}
80+ {% if perms.extras.run_report and report.test_methods|length %}
7581 < div class ="float-end noprint ">
7682 < form action ="{% url 'extras:report' module=report.module name=report.class_name %} " method ="post ">
7783 {% csrf_token %}
You can’t perform that action at this time.
0 commit comments