Skip to content

Commit

Permalink
New translations django.po (Polish)
Browse files Browse the repository at this point in the history
Add fields and the migration

Added three fields in models.py:
- setup_duration
- testing_duration
- expected_duration (property deco)

Added new migration to reflect the 2 new duration fields
- Added migration file 0018_add_testcase_duration_fiels.py
- Reflected fields are setup_duration and testing_duration
- The affected models are Testcase and Historicaltestcase

Fixes lint failures and adds fields to templates kiwitcms#1923

- Migration file symbol fixes via black
- Added three fields in testcase view (get.html)
- Added two fields in testcase add & edit view

Displaying duration fields in testcase.get kiwitcms#1923

- Displays fields directly from objects into get.html
- Removed todos
- Fixed duplicate line

Fixes empty fields bug for merge into master kiwitcms#1923

- `setup_duration` and `testing_duration` now defaultly nulled until API calls are implemented
- `expected_duration` default return 0 as property for same reason

Modified expected_duration property to reflect business logic better kiwitcms#1923
  • Loading branch information
kiwitcms-bot authored and APiligrim committed Mar 24, 2021
1 parent 854553b commit 61136f7
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tcms/locale/pl_PL/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: kiwitcms\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-09 15:57+0000\n"
"PO-Revision-Date: 2021-03-23 14:16\n"
"PO-Revision-Date: 2021-03-23 14:30\n"
"Last-Translator: \n"
"Language-Team: Polish\n"
"Language: pl_PL\n"
Expand Down Expand Up @@ -351,12 +351,12 @@ msgstr ""

#: tcms/core/templates/dashboard.html:3
msgid "Dashboard"
msgstr ""
msgstr "Pulpit"

#: tcms/core/templates/dashboard.html:8
#: tcms/testruns/templates/testruns/get.html:176
msgid "Test executions"
msgstr "Uruchomienia testów"
msgstr "Wykonania testów"

#: tcms/core/templates/dashboard.html:15
#, python-format
Expand Down Expand Up @@ -537,11 +537,11 @@ msgstr "Matryca statusu"
#: tcms/settings/common.py:321
#: tcms/telemetry/templates/telemetry/testing/execution-trends.html:5
msgid "Execution trends"
msgstr ""
msgstr "Trendy wykonania"

#: tcms/settings/common.py:322
msgid "TestCase health"
msgstr ""
msgstr "Kondycja przypadku testowego"

#: tcms/settings/common.py:332
msgid "ADMIN"
Expand Down Expand Up @@ -1441,7 +1441,7 @@ msgstr "Powiadom:"

#: tcms/testplans/templates/testplans/mutable.html:110
msgid "TestCase author"
msgstr "Autora Przypadku Testowego"
msgstr "Autora przypadku testowego"

#: tcms/testplans/templates/testplans/mutable.html:124
msgid "Notify when:"
Expand Down Expand Up @@ -1744,7 +1744,7 @@ msgstr ""

#: tcms_github_marketplace/templates/tcms_github_marketplace/subscription.html:24
msgid "Tenant"
msgstr ""
msgstr "Tenant"

#: tcms_github_marketplace/templates/tcms_github_marketplace/subscription.html:35
#: tcms_github_marketplace/templates/tcms_github_marketplace/subscription.html:66
Expand Down
33 changes: 33 additions & 0 deletions tcms/testcases/migrations/0018_add_testcase_duration_fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 3.1.6 on 2021-02-16 09:40

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("testcases", "0017_rename_related_names"),
]

operations = [
migrations.AddField(
model_name="historicaltestcase",
name="setup_duration",
field=models.DurationField(blank=True, db_index=True, null=True),
),
migrations.AddField(
model_name="historicaltestcase",
name="testing_duration",
field=models.DurationField(blank=True, db_index=True, null=True),
),
migrations.AddField(
model_name="testcase",
name="setup_duration",
field=models.DurationField(blank=True, db_index=True, null=True),
),
migrations.AddField(
model_name="testcase",
name="testing_duration",
field=models.DurationField(blank=True, db_index=True, null=True),
),
]
12 changes: 12 additions & 0 deletions tcms/testcases/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import vinaigrette
from datetime import timedelta
from django.conf import settings
from django.db import models
from django.db.models import ObjectDoesNotExist
Expand Down Expand Up @@ -55,6 +56,17 @@ class TestCase(models.Model, UrlMixin):
requirement = models.CharField(max_length=255, blank=True, null=True)
notes = models.TextField(blank=True, null=True)
text = models.TextField(blank=True)
setup_duration = models.DurationField(db_index=True, null=True, blank=True)
testing_duration = models.DurationField(db_index=True, null=True, blank=True)

@property
def expected_duration(self):
if not self.setup_duration and not self.testing_duration:
return None
result = timedelta(0)
result += self.setup_duration or timedelta(0)
result += self.testing_duration or timedelta(0)
return result

case_status = models.ForeignKey(TestCaseStatus, on_delete=models.CASCADE)
category = models.ForeignKey(
Expand Down
15 changes: 15 additions & 0 deletions tcms/testcases/templates/testcases/get.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ <h2 class="card-pf-title" style="text-align: left">
<span class="fa fa-calendar"></span>{{ object.create_date }}
</h2>

<h2 class="card-pf-title" style="text-align: left">
<span class="fa fa-clock-o"></span>{% trans 'Setup duration' %}:
{{ object.setup_duration }}
</h2>

<h2 class="card-pf-title" style="text-align: left">
<span class="fa fa-clock-o"></span>{% trans 'Testing duration' %}:
{{ object.testing_duration }}
</h2>

<h2 class="card-pf-title" style="text-align: left">
<span class="fa fa-clock-o"></span>{% trans 'Expected duration' %}:
{{ object.expected_duration }}
</h2>

<h2 class="card-pf-title" style="text-align: left">
<span class="fa
{% if object.is_automated %}
Expand Down

0 comments on commit 61136f7

Please sign in to comment.