allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [29/50] [abbrv] allura git commit: [#7919] change tests from options_on_install page to install_tool page; remove core dep on Tracker
Date Fri, 08 Jan 2016 19:30:34 GMT
[#7919] change tests from options_on_install page to install_tool page; remove core dep on
Tracker


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/4f50aaff
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/4f50aaff
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/4f50aaff

Branch: refs/heads/master
Commit: 4f50aaff43e19dc35083cd180d6c6f77520ad3b0
Parents: 148b9f4
Author: Dave Brondsema <dave@brondsema.net>
Authored: Thu Dec 10 18:14:03 2015 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Jan 8 14:06:17 2016 -0500

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_admin.py | 37 ++++++++++++-----------
 1 file changed, 19 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/4f50aaff/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index cf5a1c0..c602243 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -42,7 +42,6 @@ from allura.lib.plugin import AdminExtension
 from allura.lib import helpers as h
 from allura.ext.admin.admin_main import AdminApp
 
-from forgetracker.tracker_main import ForgeTrackerApp
 from forgewiki.wiki_main import ForgeWikiApp
 
 
@@ -378,17 +377,19 @@ class TestProjectAdmin(TestController):
             assert 'error' in self.webflash(r)
             assert 'limit exceeded' in self.webflash(r)
 
-    def test_tool_options_on_install(self):
-        self.app.get('/admin/options_on_install', status=404)
-        self.app.get('/admin/options_on_install?tool_name=fake', status=404)
-        r = self.app.get('/admin/options_on_install?tool_name=tickets')
-        assert_equals(r.body, '')
-        opts = ['EnableVoting']
-        with mock.patch.object(ForgeTrackerApp, 'config_on_install', new=opts):
-            r = self.app.get('/admin/options_on_install?tool_name=tickets')
-            inp_opts = {'type': 'checkbox', 'id': 'EnableVoting', 'name': 'EnableVoting'}
-            inp = r.html.findAll('input', inp_opts)
-            assert_equals(len(inp), 1)
+    def test_install_tool_form(self):
+        r = self.app.get('/admin/install_tool?tool_name=wiki')
+        assert_in(u'Installing Wiki', r)
+
+    def test_install_tool_form_options(self):
+        opts = ['AllowEmailPosting']
+        with mock.patch.object(ForgeWikiApp, 'config_on_install', new=opts):
+            r = self.app.get('/admin/install_tool?tool_name=wiki')
+            assert_in(u'<input id="AllowEmailPosting" name="AllowEmailPosting"', r)
+
+    def test_install_tool_form_subproject(self):
+        r = self.app.get('/admin/install_tool?tool_name=subproject')
+        assert_in(u'Installing Sub Project', r)
 
     def test_grouping_threshold(self):
         r = self.app.get('/admin/tools')
@@ -1276,20 +1277,20 @@ class TestRestInstallTool(TestRestApiBase):
         assert_equals(audit_log.message, 'install tool ticketsmount1')
 
     def test_tool_exists(self):
-        with mock.patch.object(ForgeTrackerApp, 'max_instances') as mi:
+        with mock.patch.object(ForgeWikiApp, 'max_instances') as mi:
             mi.__get__ = mock.Mock(return_value=2)
             r = self.api_get('/rest/p/test/')
             tools_names = [t['name'] for t in r.json['tools']]
-            assert 'tickets' not in tools_names
+            assert 'wiki' not in tools_names
 
             data = {
-                'tool': 'tickets',
-                'mount_point': 'ticketsmount1',
-                'mount_label': 'tickets_label1'
+                'tool': 'wiki',
+                'mount_point': 'wikimount1',
+                'mount_label': 'wiki_label1'
             }
             project = M.Project.query.get(shortname='test')
             with h.push_config(c, user=M.User.query.get()):
-                project.install_app('tickets', mount_point=data['mount_point'])
+                project.install_app('wiki', mount_point=data['mount_point'])
             r = self.api_post('/rest/p/test/admin/install_tool/', **data)
             assert_equals(r.json['success'], False)
             assert_equals(r.json['info'], 'Mount point already exists.')


Mime
View raw message