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 2015/12/17 20:22:28 UTC

[41/50] [abbrv] allura git commit: [#7919] change tests from options_on_install page to install_tool page; remove core dep on Tracker

[#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/d1e2b7cb
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d1e2b7cb
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d1e2b7cb

Branch: refs/heads/db/8034
Commit: d1e2b7cb6fad5e4fd3b255c380f0ba38cfb87904
Parents: 152d783
Author: Dave Brondsema <da...@brondsema.net>
Authored: Thu Dec 10 18:14:03 2015 -0500
Committer: Heith Seewald <he...@gmail.com>
Committed: Wed Dec 16 15:50:52 2015 -0600

----------------------------------------------------------------------
 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/d1e2b7cb/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.')