allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [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'
Date Sun, 22 Jul 2018 19:45:33 GMT
[#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 <deshani.14@cse.mrt.ac.lk>
Authored: Sat Jul 21 19:53:15 2018 +0530
Committer: deshanigtk <deshani.14@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))


Mime
View raw message