You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2018/07/22 19:45:31 UTC
[1/4] allura git commit: [#8219] Personal Dashboard - Test Tickets
section
Repository: allura
Updated Branches:
refs/heads/master 50d318d1e -> 43c241b96
[#8219] Personal Dashboard - Test Tickets section
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a7ddd0c0
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a7ddd0c0
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a7ddd0c0
Branch: refs/heads/master
Commit: a7ddd0c0bbcfe89cb14fc5214deff168cbb20477
Parents: 50d318d
Author: deshanigtk <de...@cse.mrt.ac.lk>
Authored: Fri Jul 13 17:32:50 2018 +0530
Committer: deshanigtk <de...@cse.mrt.ac.lk>
Committed: Mon Jul 16 18:58:45 2018 +0530
----------------------------------------------------------------------
.../tests/functional/test_personal_dashboard.py | 47 ++++++++++++++++++++
1 file changed, 47 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/a7ddd0c0/Allura/allura/tests/functional/test_personal_dashboard.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_personal_dashboard.py b/Allura/allura/tests/functional/test_personal_dashboard.py
index 9df4441..46912c1 100644
--- a/Allura/allura/tests/functional/test_personal_dashboard.py
+++ b/Allura/allura/tests/functional/test_personal_dashboard.py
@@ -19,8 +19,13 @@ import mock
import tg
from nose.tools import assert_equal, assert_in, assert_not_in
+from allura import model as M
from allura.lib.widgets.user_profile import SectionsUtil
from allura.tests import TestController
+from allura.tests import decorators as td
+from ming.orm.ormsession import ThreadLocalORMSession
+
+from forgetracker.tests.functional.test_root import TrackerTestController
class TestPersonalDashboard(TestController):
@@ -57,3 +62,45 @@ class TestPersonalDashboard(TestController):
assert_in('Section c', r.body)
assert_in('Section d', r.body)
assert_not_in('Section f', r.body)
+
+
+class TestTicketsSection(TestController):
+
+ def _find_new_ticket_form(self, resp):
+ def cond(f):
+ return f.action.endswith('/save_ticket')
+
+ return self.find_form(resp, cond)
+
+ def new_ticket(self, mount_point='/bugs/', extra_environ=None, **kw):
+ extra_environ = extra_environ or {}
+ response = self.app.get(mount_point + 'new/',
+ extra_environ=extra_environ)
+ form = self._find_new_ticket_form(response)
+ # If this is ProjectUserCombo's select populate it
+ # with all the users in the project. This is a workaround for tests,
+ # in real enviroment this is populated via ajax.
+ p = M.Project.query.get(shortname='test')
+ for f in form.fields:
+ field = form[f] if f else None
+ is_usercombo = (field and field.tag == 'select' and
+ field.attrs.get('class') == 'project-user-combobox')
+ if is_usercombo:
+ field.options = [('', False)] + [(u.username, False)
+ for u in p.users()]
+
+ for k, v in kw.iteritems():
+ form['ticket_form.%s' % k] = v
+ resp = form.submit(extra_environ=extra_environ)
+ assert resp.status_int != 200, resp
+ return resp
+
+ @td.with_tool('test/sub1', 'Tickets', 'tickets')
+ def test_tickets_section(self):
+ self.new_ticket(summary="my ticket", _milestone='1.0', mount_point="/sub1/tickets/")
+ ThreadLocalORMSession.flush_all()
+ M.MonQTask.run_ready()
+ ThreadLocalORMSession.flush_all()
+ response = self.app.get('/dashboard')
+ ticket_rows = response.html.find('tbody')
+ assert_in('my ticket', str(ticket_rows))
[2/4] allura git commit: [#8219] Personal Dashboard - Test Tickets
section and fix issue in tickets.html
Posted by br...@apache.org.
[#8219] Personal Dashboard - Test Tickets section and fix issue in tickets.html
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/3548605b
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/3548605b
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/3548605b
Branch: refs/heads/master
Commit: 3548605b7609ce97c6091f84b15c22c9450be3a0
Parents: a7ddd0c
Author: deshanigtk <de...@cse.mrt.ac.lk>
Authored: Tue Jul 17 22:48:57 2018 +0530
Committer: deshanigtk <de...@cse.mrt.ac.lk>
Committed: Tue Jul 17 22:48:57 2018 +0530
----------------------------------------------------------------------
.../templates/sections/tickets.html | 1 -
.../tests/functional/test_personal_dashboard.py | 17 +++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/3548605b/Allura/allura/ext/personal_dashboard/templates/sections/tickets.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/personal_dashboard/templates/sections/tickets.html b/Allura/allura/ext/personal_dashboard/templates/sections/tickets.html
index f45cbc7..6484af0 100644
--- a/Allura/allura/ext/personal_dashboard/templates/sections/tickets.html
+++ b/Allura/allura/ext/personal_dashboard/templates/sections/tickets.html
@@ -33,7 +33,6 @@
{% if count %}
{{ page_size.display(page=page, count=count, limit=limit) }}
<table>
- <tbody>
<thead>
<tr>
<th data-sort="ticket_num_i">#</th>
http://git-wip-us.apache.org/repos/asf/allura/blob/3548605b/Allura/allura/tests/functional/test_personal_dashboard.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_personal_dashboard.py b/Allura/allura/tests/functional/test_personal_dashboard.py
index 46912c1..37d78ff 100644
--- a/Allura/allura/tests/functional/test_personal_dashboard.py
+++ b/Allura/allura/tests/functional/test_personal_dashboard.py
@@ -23,7 +23,6 @@ from allura import model as M
from allura.lib.widgets.user_profile import SectionsUtil
from allura.tests import TestController
from allura.tests import decorators as td
-from ming.orm.ormsession import ThreadLocalORMSession
from forgetracker.tests.functional.test_root import TrackerTestController
@@ -64,7 +63,13 @@ class TestPersonalDashboard(TestController):
assert_not_in('Section f', r.body)
-class TestTicketsSection(TestController):
+class TestTicketsSection(TrackerTestController):
+
+ @td.with_tracker
+ def setup_with_tools(self):
+ self.project = M.Project.query.get(shortname='test2')
+ self.tracker = self.project.app_instance('bugs')
+ self.new_ticket(summary='foo', _milestone='1.0', assigned_to='test-admin')
def _find_new_ticket_form(self, resp):
def cond(f):
@@ -95,12 +100,8 @@ class TestTicketsSection(TestController):
assert resp.status_int != 200, resp
return resp
- @td.with_tool('test/sub1', 'Tickets', 'tickets')
+ @td.with_tool('test2', 'Tickets', 'tickets')
def test_tickets_section(self):
- self.new_ticket(summary="my ticket", _milestone='1.0', mount_point="/sub1/tickets/")
- ThreadLocalORMSession.flush_all()
- M.MonQTask.run_ready()
- ThreadLocalORMSession.flush_all()
response = self.app.get('/dashboard')
ticket_rows = response.html.find('tbody')
- assert_in('my ticket', str(ticket_rows))
+ assert_in('foo', str(ticket_rows))
[4/4] allura git commit: [#8219] omit test that needs MockSOLR to
support "OR"
Posted by br...@apache.org.
[#8219] omit test that needs MockSOLR to support "OR"
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/43c241b9
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/43c241b9
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/43c241b9
Branch: refs/heads/master
Commit: 43c241b9643e8df8d22bf8b37364071b7dc7f3e4
Parents: 986bab0
Author: Dave Brondsema <da...@brondsema.net>
Authored: Sun Jul 22 15:44:51 2018 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Sun Jul 22 15:44:51 2018 -0400
----------------------------------------------------------------------
Allura/allura/tests/functional/test_personal_dashboard.py | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/43c241b9/Allura/allura/tests/functional/test_personal_dashboard.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_personal_dashboard.py b/Allura/allura/tests/functional/test_personal_dashboard.py
index 6fe04e8..3a3e8fa 100644
--- a/Allura/allura/tests/functional/test_personal_dashboard.py
+++ b/Allura/allura/tests/functional/test_personal_dashboard.py
@@ -69,7 +69,6 @@ class TestTicketsSection(TrackerTestController):
def setup_with_tools(self):
self.project = M.Project.query.get(shortname='test2')
self.tracker = self.project.app_instance('bugs')
- self.new_ticket(summary='bar', _milestone='1.0')
self.new_ticket(summary='foo', _milestone='1.0', assigned_to='test-admin')
@td.with_tool('test2', 'Tickets', 'tickets')
@@ -77,4 +76,3 @@ class TestTicketsSection(TrackerTestController):
response = self.app.get('/dashboard')
ticket_rows = response.html.find('tbody')
assert_in('foo', str(ticket_rows))
- assert_in('bar', str(ticket_rows))
[3/4] allura git commit: [#8219] Personal Dashboard - Refactor the
code. Issue exist when testing the search query - 'assigned_to_s' OR
'reported_by_s'
Posted by br...@apache.org.
[#8219] Personal Dashboard - Refactor the code. Issue exist when testing the search query - 'assigned_to_s' OR 'reported_by_s'
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/986bab08
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/986bab08
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/986bab08
Branch: refs/heads/master
Commit: 986bab083cfbea117fbc8fe803e6c21b6b7df019
Parents: 3548605
Author: deshanigtk <de...@cse.mrt.ac.lk>
Authored: Sat Jul 21 19:53:15 2018 +0530
Committer: deshanigtk <de...@cse.mrt.ac.lk>
Committed: Sat Jul 21 19:53:15 2018 +0530
----------------------------------------------------------------------
.../tests/functional/test_personal_dashboard.py | 31 ++------------------
1 file changed, 2 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/986bab08/Allura/allura/tests/functional/test_personal_dashboard.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_personal_dashboard.py b/Allura/allura/tests/functional/test_personal_dashboard.py
index 37d78ff..6fe04e8 100644
--- a/Allura/allura/tests/functional/test_personal_dashboard.py
+++ b/Allura/allura/tests/functional/test_personal_dashboard.py
@@ -69,39 +69,12 @@ class TestTicketsSection(TrackerTestController):
def setup_with_tools(self):
self.project = M.Project.query.get(shortname='test2')
self.tracker = self.project.app_instance('bugs')
+ self.new_ticket(summary='bar', _milestone='1.0')
self.new_ticket(summary='foo', _milestone='1.0', assigned_to='test-admin')
- def _find_new_ticket_form(self, resp):
- def cond(f):
- return f.action.endswith('/save_ticket')
-
- return self.find_form(resp, cond)
-
- def new_ticket(self, mount_point='/bugs/', extra_environ=None, **kw):
- extra_environ = extra_environ or {}
- response = self.app.get(mount_point + 'new/',
- extra_environ=extra_environ)
- form = self._find_new_ticket_form(response)
- # If this is ProjectUserCombo's select populate it
- # with all the users in the project. This is a workaround for tests,
- # in real enviroment this is populated via ajax.
- p = M.Project.query.get(shortname='test')
- for f in form.fields:
- field = form[f] if f else None
- is_usercombo = (field and field.tag == 'select' and
- field.attrs.get('class') == 'project-user-combobox')
- if is_usercombo:
- field.options = [('', False)] + [(u.username, False)
- for u in p.users()]
-
- for k, v in kw.iteritems():
- form['ticket_form.%s' % k] = v
- resp = form.submit(extra_environ=extra_environ)
- assert resp.status_int != 200, resp
- return resp
-
@td.with_tool('test2', 'Tickets', 'tickets')
def test_tickets_section(self):
response = self.app.get('/dashboard')
ticket_rows = response.html.find('tbody')
assert_in('foo', str(ticket_rows))
+ assert_in('bar', str(ticket_rows))