Skip to content

Commit

Permalink
On dashboard show TRs which have cases assigned to current user
Browse files Browse the repository at this point in the history
Fix #520.

Use case:
We usually create one TestRun for one version of the product
which contains lots of cases assigned to multiple testers.
To simplify the procedure for testers (to avoid searching for specific
TestRun or having to save direct URL to it) it would be beneficial
to show link to Test Run in Test Executions section on Dashboard
to all users which are assigned to at least one test case in that
Test Run.
  • Loading branch information
atodorov committed Oct 25, 2018
1 parent b7ca833 commit d8fb7ba
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 72 deletions.
20 changes: 20 additions & 0 deletions tcms/core/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from tcms.tests import user_should_have_perm
from tcms.tests.factories import UserFactory
from tcms.tests.factories import TestPlanFactory
from tcms.tests.factories import TestRunFactory
from tcms.tests.factories import TestCaseRunFactory


class TestNavigation(test.TestCase):
Expand Down Expand Up @@ -63,6 +65,24 @@ def test_when_logged_in_renders_dashboard(self):
self.assertContains(response, 'Test Plans')
self.assertContains(response, 'Test Runs')

def test_dashboard_shows_testruns_for_manager(self):
test_run = TestRunFactory(manager=self.tester)

response = self.client.get(reverse('core-views-index'))
self.assertContains(response, test_run.summary)

def test_dashboard_shows_testruns_for_default_tester(self):
test_run = TestRunFactory(default_tester=self.tester)

response = self.client.get(reverse('core-views-index'))
self.assertContains(response, test_run.summary)

def test_dashboard_shows_testruns_for_test_case_run_assignee(self):
test_case_run = TestCaseRunFactory(assignee=self.tester)

response = self.client.get(reverse('core-views-index'))
self.assertContains(response, test_case_run.run.summary)


class TestCommentCaseRuns(BaseCaseRun):
"""Test case for ajax.comment_case_runs"""
Expand Down
4 changes: 3 additions & 1 deletion tcms/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def dashboard(request):
test_plans_disable_count = test_plans.filter(is_active=False).count()

test_runs = TestRun.objects.filter(
Q(manager=request.user) | Q(default_tester=request.user),
Q(manager=request.user) |
Q(default_tester=request.user) |
Q(case_run__assignee=request.user),
stop_date__isnull=True,
).order_by('-run_id')

Expand Down
7 changes: 3 additions & 4 deletions tcms/locale/de_DE/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kiwitcms\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-19 10:17+0000\n"
"POT-Creation-Date: 2018-10-25 11:46+0000\n"
"PO-Revision-Date: 2018-10-04 12:10\n"
"Last-Translator: atodorov <[email protected]>\n"
"Language-Team: German\n"
Expand Down Expand Up @@ -231,11 +231,10 @@ msgid "Started at"
msgstr "Gestartet am"

#: tcms/templates/dashboard.html:26
#, python-format
msgid ""
"\n"
" %(total_count)s TestRun(s) assigned to you need to be "
"executed.\n"
" %(total_count)s TestRun(s) or TestCase(s) assigned to you "
"need to be executed.\n"
" Here are the latest %(count)s.\n"
" "
msgstr ""
Expand Down
6 changes: 3 additions & 3 deletions tcms/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-19 10:17+0000\n"
"POT-Creation-Date: 2018-10-25 11:46+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -231,8 +231,8 @@ msgstr ""
#, python-format
msgid ""
"\n"
" %(total_count)s TestRun(s) assigned to you need to be "
"executed.\n"
" %(total_count)s TestRun(s) or TestCase(s) assigned to you "
"need to be executed.\n"
" Here are the latest %(count)s.\n"
" "
msgstr ""
Expand Down
169 changes: 112 additions & 57 deletions tcms/locale/sl_SI/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ msgid ""
msgstr ""
"Project-Id-Version: kiwitcms\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-19 10:17+0000\n"
"POT-Creation-Date: 2018-10-25 11:46+0000\n"
"PO-Revision-Date: 2018-10-20 14:15\n"
"Last-Translator: atodorov <[email protected]>\n"
"Language-Team: Slovenian\n"
"Language: sl_SI\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n"
"%100==4 ? 3 : 0);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: kiwitcms\n"
"X-Crowdin-Language: sl\n"
Expand Down Expand Up @@ -49,21 +50,31 @@ msgstr "POSODOBITEV: %(model_name)s #%(pk)d - %(title)s"

#: tcms/core/history.py:47
#, python-format
msgid "Updated on %(history_date)s\n"
"Updated by %(username)s\n\n"
"%(diff)s\n\n"
msgid ""
"Updated on %(history_date)s\n"
"Updated by %(username)s\n"
"\n"
"%(diff)s\n"
"\n"
"For more information:\n"
"%(instance_url)s"
msgstr "Čas posodobitve %(history_date)s\n"
"Posodobil %(username)s\n\n"
"%(diff)s\n\n"
msgstr ""
"Čas posodobitve %(history_date)s\n"
"Posodobil %(username)s\n"
"\n"
"%(diff)s\n"
"\n"
"Dodatne informacije:\n"
"%(instance_url)s"

#: tcms/core/middleware.py:25
#, python-format
msgid "Base URL is not configured! See <a href=\"%s\">documentation</a> and <a href=\"%s\">change it</a>"
msgstr "URL aplikacije ni nastavljen! <a href=\"%s\">Preverite dokumentacijo</a> in ga <a href=\"%s\">spremenite</a>"
msgid ""
"Base URL is not configured! See <a href=\"%s\">documentation</a> and <a href="
"\"%s\">change it</a>"
msgstr ""
"URL aplikacije ni nastavljen! <a href=\"%s\">Preverite dokumentacijo</a> in "
"ga <a href=\"%s\">spremenite</a>"

#: tcms/kiwi_auth/admin.py:24
msgid "This email address is already in use"
Expand All @@ -87,12 +98,18 @@ msgid "Your new %s account confirmation"
msgstr "Informacije o uporabniškem računu %s ."

#: tcms/kiwi_auth/views.py:47
msgid "Your account has been created, please check your mailbox for confirmation"
msgstr "Uporabniški račun je bil uspešno kreiran, preverite vaš e-poštni nabiralnik za potrditveno povezavo preko katere ga aktivirate"
msgid ""
"Your account has been created, please check your mailbox for confirmation"
msgstr ""
"Uporabniški račun je bil uspešno kreiran, preverite vaš e-poštni nabiralnik "
"za potrditveno povezavo preko katere ga aktivirate"

#: tcms/kiwi_auth/views.py:53
msgid "Your account has been created, but you need an administrator to activate it"
msgstr "Uporabniški račun je bil ustvarjen. Pred uporabo ga mora potrditi še administrator"
msgid ""
"Your account has been created, but you need an administrator to activate it"
msgstr ""
"Uporabniški račun je bil ustvarjen. Pred uporabo ga mora potrditi še "
"administrator"

#: tcms/kiwi_auth/views.py:59
msgid "Following is the administrator list"
Expand Down Expand Up @@ -224,15 +241,13 @@ msgid "Started at"
msgstr "Začeto ob"

#: tcms/templates/dashboard.html:26
#, python-format
msgid "\n"
" %(total_count)s TestRun(s) assigned to you need to be executed.\n"
msgid ""
"\n"
" %(total_count)s TestRun(s) or TestCase(s) assigned to you "
"need to be executed.\n"
" Here are the latest %(count)s.\n"
" "
msgstr "\n"
" %(total_count)s testiranj čaka na izvedbo\n"
" Zadnja dodeljena testiranja %(count)s.\n"
" "
msgstr ""

#: tcms/templates/dashboard.html:32 tcms/templates/dashboard.html:78
msgid "SEE ALL"
Expand Down Expand Up @@ -272,12 +287,16 @@ msgstr "Izvedbe"

#: tcms/templates/dashboard.html:72
#, python-format
msgid "\n"
" You manage %(total_count)s TestPlan(s), %(disabled_count)s are disabled.\n"
msgid ""
"\n"
" You manage %(total_count)s TestPlan(s), %(disabled_count)s "
"are disabled.\n"
" Here are the latest %(count)s.\n"
" "
msgstr "\n"
" Imate %(total_count)s reopozitorijev testov, %(disabled_count)s je onemogočenih.\n"
msgstr ""
"\n"
" Imate %(total_count)s reopozitorijev testov, "
"%(disabled_count)s je onemogočenih.\n"
" Tukaj so zadnji %(count)s.\n"
" "

Expand All @@ -287,61 +306,84 @@ msgstr "Noben testni plan vam ni dodeljen"

#: tcms/templates/email/confirm_registration.txt:1
#, python-format
msgid "Welcome %(user)s,\n"
"thank you for signing up for an %(site_domain)s account!\n\n"
msgid ""
"Welcome %(user)s,\n"
"thank you for signing up for an %(site_domain)s account!\n"
"\n"
"To activate your account, click this link:\n"
"%(confirm_url)s\n"
msgstr "Pozdravljen-/a %(user)s,\n"
"uspešno je bil kreiran uporabniški račun za domeno %(site_domain)s !\n\n"
msgstr ""
"Pozdravljen-/a %(user)s,\n"
"uspešno je bil kreiran uporabniški račun za domeno %(site_domain)s !\n"
"\n"
"Za aktivacijo računa kliknite na spodnjo povezavo\n"
"%(confirm_url)s\n"

#: tcms/templates/email/post_case_delete/email.txt:2
#, python-format
msgid "\n"
msgid ""
"\n"
"TestCase has been updated by %(username)s!\n"
msgstr "\n"
msgstr ""
"\n"
"Testni scenarij je posodobil %(username)s!\n"

#: tcms/templates/email/post_run_save/email.txt:2
#, python-format
msgid "\n"
"Test run %(pk)s has been created or updated for you.\n\n"
msgid ""
"\n"
"Test run %(pk)s has been created or updated for you.\n"
"\n"
"### Links ###\n"
"Test run: %(run_url)s\n"
"Test plan: %(plan_url)s\n\n"
"Test plan: %(plan_url)s\n"
"\n"
"### Basic run information ###\n"
"Summary: %(summary)s\n\n"
"Summary: %(summary)s\n"
"\n"
"Managed: %(manager)s.\n"
"Default tester: %(default_tester)s.\n\n"
"Default tester: %(default_tester)s.\n"
"\n"
"Product: %(product)s\n"
"Product version: %(version)s\n"
"Build: %(build)s\n\n"
"Build: %(build)s\n"
"\n"
"Notes:\n"
"%(notes)s\n"
msgstr "\n"
"Testiranje %(pk)s je bilo ustvarjeno ali posobljeno.\n\n"
msgstr ""
"\n"
"Testiranje %(pk)s je bilo ustvarjeno ali posobljeno.\n"
"\n"
"### Povezano ###\n"
"Testiranje: %(run_url)s\n"
"Baza testnih scenarijev: %(plan_url)s\n\n"
"Baza testnih scenarijev: %(plan_url)s\n"
"\n"
"### Osnovne informacije o testiranju ###\n"
"Povzetek: %(summary)s\n\n"
"Povzetek: %(summary)s\n"
"\n"
"Vodja testiranja: %(manager)s.\n"
"Zadolženi tester: %(default_tester)s.\n\n"
"Zadolženi tester: %(default_tester)s.\n"
"\n"
"Produkt: %(product)s\n"
"Verzija produkta: %(version)s\n"
"Build: %(build)s\n\n"
"Build: %(build)s\n"
"\n"
"Zapiski:\n"
"%(notes)s\n"

#: tcms/templates/email/user_registered/notify_admins.txt:2
#, python-format
msgid "Dear Administrator,\n"
msgid ""
"Dear Administrator,\n"
"somebody just registered an account with username %(username)s at your\n"
"Kiwi TCMS instance and is awaiting your approval!\n\n"
"Kiwi TCMS instance and is awaiting your approval!\n"
"\n"
"Go to %(user_url)s to activate the account!\n"
msgstr "Spoštovani administrator,\n"
"uporabnik %(username)s je kreiral nov uporabniški račun v sistemu Kiwi TCMS, kateri čaka na potrditev.\n\n"
msgstr ""
"Spoštovani administrator,\n"
"uporabnik %(username)s je kreiral nov uporabniški račun v sistemu Kiwi TCMS, "
"kateri čaka na potrditev.\n"
"\n"
"Aktivacija računa je mogoča na sledeči povezavi %(user_url)s !\n"

#: tcms/templates/pagination.html:7
Expand Down Expand Up @@ -399,7 +441,9 @@ msgid "Change password"
msgstr "Spremeni geslo"

#: tcms/templates/registration/password_reset_confirm.html:43
msgid "Please enter your new password twice so we can verify you typed it in correctly"
msgid ""
"Please enter your new password twice so we can verify you typed it in "
"correctly"
msgstr "Novo geslo vnesite dvakrat"

#: tcms/templates/registration/password_reset_done.html:11
Expand Down Expand Up @@ -428,8 +472,12 @@ msgid "Register"
msgstr "Registracija"

#: tcms/testcases/forms.py:36
msgid "Please input valid case id(s). use comma to split more than one case id. e.g. \"111, 222\""
msgstr "Prosimo vnesite veljavne Id-je testni scenarijev. Uporabite vejico za več primerov npr. \"111, 222\""
msgid ""
"Please input valid case id(s). use comma to split more than one case id. e."
"g. \"111, 222\""
msgstr ""
"Prosimo vnesite veljavne Id-je testni scenarijev. Uporabite vejico za več "
"primerov npr. \"111, 222\""

#: tcms/testcases/helpers/email.py:22
#, python-brace-format
Expand Down Expand Up @@ -668,12 +716,16 @@ msgstr "Izbrani testni scenariji(s):"

#: tcms/testruns/templates/testruns/mutable.html:84
#, python-format
msgid "\n"
" %(count)s of the pre-selected test cases is not CONFIRMED and will not be cloned!\n"
msgid ""
"\n"
" %(count)s of the pre-selected test cases is not "
"CONFIRMED and will not be cloned!\n"
" See test plan for more details!\n"
" "
msgstr "\n"
" %(count)s testni scenarijev ni v statusu potrjen in se ne bodo prenesli.\n"
msgstr ""
"\n"
" %(count)s testni scenarijev ni v statusu potrjen in se "
"ne bodo prenesli.\n"
" Več podrobnosti je na voljo v informacijah testiranja!\n"
" "

Expand Down Expand Up @@ -703,11 +755,15 @@ msgstr "Končano ob"

#: tcms/testruns/views.py:50
msgid "Creating a TestRun requires a TestPlan, select one"
msgstr "V kolikor želite kreirati novo testiranje morate imeti ustvarjen testni repozitorij"
msgstr ""
"V kolikor želite kreirati novo testiranje morate imeti ustvarjen testni "
"repozitorij"

#: tcms/testruns/views.py:60
msgid "Creating a TestRun requires at least one TestCase"
msgstr "V kolikor želite kreirati novo testiranje morate dodati najmanj en testni scenarij"
msgstr ""
"V kolikor želite kreirati novo testiranje morate dodati najmanj en testni "
"scenarij"

#: tcms/testruns/views.py:550
msgid "Clone of "
Expand Down Expand Up @@ -774,4 +830,3 @@ msgstr "ONEMOGOČEN"
#: vinaigrette-deleteme.py:13
msgid "NEED_UPDATE"
msgstr "ZA POPRAVITI"

Loading

0 comments on commit d8fb7ba

Please sign in to comment.