Skip to content

Commit 5ef7ed2

Browse files
committed
Adjust Product & Version display on TestRun page
use the relationship TR->Build as the starting point because TR->Plan is much more likely to update its Product/Version values in the future. NOTE: the field `product_version` which is removed from tests doesn't make sense because neither the underlying forms, not the underlying models have such a field.
1 parent cf8359f commit 5ef7ed2

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

tcms/templates/email/post_run_save/email.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% load i18n %}
2-
{% blocktrans with pk=test_run.pk run_url=test_run.get_full_url plan_url=test_run.plan.get_full_url summary=test_run.summary manager=test_run.manager default_tester=test_run.default_tester product=test_run.plan.product version=test_run.plan.product_version build=test_run.build notes=test_run.notes %}Test run {{ pk }} has been created or updated for you.
2+
{% blocktrans with pk=test_run.pk run_url=test_run.get_full_url plan_url=test_run.plan.get_full_url summary=test_run.summary manager=test_run.manager default_tester=test_run.default_tester product=test_run.build.version.product version=test_run.build.version build=test_run.build notes=test_run.notes %}Test run {{ pk }} has been created or updated for you.
33

44
### Links ###
55
Test run: {{ run_url }}

tcms/testruns/templates/testruns/get.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ <h2 class="card-pf-title" style="text-align: left">
4242

4343
<h2 class="card-pf-title" style="text-align: left">
4444
<span class="fa fa-shopping-cart"></span>{% trans 'Product' %}:
45-
<a href="{% url 'testruns-search' %}?product={{ object.plan.product_id }}" title="Search test runs of {{ object.plan.product }}">{{ object.plan.product }}</a>
45+
<a href="{% url 'testruns-search' %}?product={{ object.build.version.product_id }}" title="Search test runs of {{ object.build.version.product }}">{{ object.build.version.product }}</a>
4646
</h2>
4747

4848
<h2 class="card-pf-title" style="text-align: left">
4949
<span class="fa fa-random"></span>{% trans 'Version' %}:
50-
<a href="{% url 'testruns-search' %}?product={{ object.plan.product_id }}&version={{ object.plan.product_version_id }}" title="Search test runs of {{ object.plan.product_version.value }}">{{ object.plan.product_version.value }}</a>
50+
<a href="{% url 'testruns-search' %}?product={{ object.build.version.product_id }}&version={{ object.build.version_id }}" title="Search test runs of {{ object.build.version.value }}">{{ object.build.version.value }}</a>
5151
</h2>
5252

5353
<h2 class="card-pf-title" style="text-align: left">
5454
<span class="fa fa-wrench"></span>{% trans 'Build' %}:
55-
<a href="{% url 'testruns-search' %}?product={{ object.plan.product_id }}&version={{ object.plan.product_version_id }}&build={{ object.build_id }}" title="Search test runs of {{ object.build }}">{{ object.build }}</a>
55+
<a href="{% url 'testruns-search' %}?product={{ object.build.version.product_id }}&version={{ object.build.version_id }}&build={{ object.build_id }}" title="Search test runs of {{ object.build }}">{{ object.build }}</a>
5656
</h2>
5757

5858
<h2 class="card-pf-title" style="text-align: left">
@@ -295,7 +295,7 @@ <h2 class="card-pf-title">
295295
</button>
296296

297297
<button class="btn btn-default"
298-
href="{% url 'testcases-search' %}?product={{ object.plan.product_id }}{% for status in confirmed_statuses %}&case_status={{ status.pk }}{% endfor %}"
298+
href="{% url 'testcases-search' %}?product={{ object.build.version.product_id }}{% for status in confirmed_statuses %}&case_status={{ status.pk }}{% endfor %}"
299299
id="btn-search-cases" title="{% trans 'Advanced search' %}">
300300
<span class="fa fa-search"></span>
301301
</button>

tcms/testruns/tests/test_permissions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def setUpTestData(cls):
3030
"manager": cls.test_run.manager.email,
3131
"default_tester": intern.email,
3232
"notes": "New run notes",
33-
"product_version": cls.test_run.plan.product_version.pk,
3433
"plan": cls.test_run.plan.pk,
3534
}
3635
super().setUpTestData()

tcms/testruns/tests/test_views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ def test_post_creates_new_run(self):
114114
post_data = {
115115
"summary": new_run_summary,
116116
"plan": self.plan.pk,
117-
"product_id": self.plan.product_id,
118-
"product": self.plan.product_id,
117+
"product_id": self.build.version.product_id,
118+
"product": self.build.version.product_id,
119119
"build": self.build.pk,
120120
"manager": self.tester.email,
121121
"default_tester": self.tester.email,

0 commit comments

Comments
 (0)