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 2013/08/21 22:12:57 UTC

[41/50] git commit: [#3154] ticket:408 refactored export tests

[#3154]  ticket:408 refactored export tests


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

Branch: refs/heads/db/3154b
Commit: 0ac70669a23da3afa00456bd7c589887a7dfa6db
Parents: 28d9046
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Mon Aug 12 14:23:27 2013 +0400
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 21 18:12:27 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_admin.py | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ac70669/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 6d17263..4fd0d19 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -806,12 +806,11 @@ class TestExport(TestController):
         assert_in('Wiki2</label> <a href="/p/test/wiki2/">/p/test/wiki2/</a>', r)
         assert_not_in('Search</label> <a href="/p/test/search/">/p/test/search/</a>', r)
 
-    @patch('allura.ext.search.search_main.SearchApp.exportable')
-    def test_export_page_contains_hidden_tools(self, search_app):
-        project = M.Project.query.get(shortname='test')
-        tools = [t.options.mount_point
-                 for t in AdminApp.exportable_tools_for(project)]
-        assert_equals(tools, [u'search', u'wiki', u'wiki2'])
+    def test_export_page_contains_hidden_tools(self):
+        with patch('allura.ext.search.search_main.SearchApp.exportable'):
+            project = M.Project.query.get(shortname='test')
+            tools = [t.options.mount_point for t in AdminApp.exportable_tools_for(project)]
+            assert_equals(tools, [u'search', u'wiki', u'wiki2'])
 
     def test_tools_not_selected(self):
         r = self.app.post('/admin/export')
@@ -842,7 +841,6 @@ class TestExport(TestController):
         shutil.rmtree(p.bulk_export_path(), ignore_errors=True)
         os.makedirs(tmpdir)
         r = self.app.post('/admin/export', {'tools': [u'wiki', u'wiki2']})
-        r = self.app.post('/admin/export', {'tools': [u'wiki', u'wiki2']})
         assert_in('info', self.webflash(r))
         assert_equals(export_tasks.bulk_export.post.call_count, 0)
         shutil.rmtree(p.bulk_export_path(), ignore_errors=True)