allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject allura git commit: Fix 2 tests that were failing when run with real mongo
Date Thu, 24 Mar 2016 11:37:27 GMT
Repository: allura
Updated Branches:
  refs/heads/master 8637eb74e -> 0ca4f4392


Fix 2 tests that were failing when run with real mongo


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

Branch: refs/heads/master
Commit: 0ca4f4392f43f1c7e5cd77be32a0a4285f7f4958
Parents: 8637eb7
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Tue Mar 15 16:25:32 2016 +0000
Committer: Heith Seewald <heiths@gmail.com>
Committed: Thu Mar 24 07:31:46 2016 -0400

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_admin.py          |  2 +-
 .../forgeimporters/github/tests/test_wiki.py          | 14 +++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/0ca4f439/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 70b1df6..a4edc44 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -1251,7 +1251,7 @@ class TestRestInstallTool(TestRestApiBase):
         assert_equals(project.ordered_mounts()
                       [-1]['ac'].options.mount_point, 'ticketsmount1')
         audit_log = M.AuditLog.query.find(
-            {'project_id': project._id}).sort({'_id': -1}).first()
+            {'project_id': project._id}).sort('_id', -1).first()
         assert_equals(audit_log.message, 'install tool ticketsmount1')
 
     def test_tool_exists(self):

http://git-wip-us.apache.org/repos/asf/allura/blob/0ca4f439/ForgeImporters/forgeimporters/github/tests/test_wiki.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tests/test_wiki.py b/ForgeImporters/forgeimporters/github/tests/test_wiki.py
index 6523de6..fa066b8 100644
--- a/ForgeImporters/forgeimporters/github/tests/test_wiki.py
+++ b/ForgeImporters/forgeimporters/github/tests/test_wiki.py
@@ -578,9 +578,17 @@ class TestGitHubWikiImportController(TestController, TestCase):
         self.assertEqual(u'import_history', args['tool_option'])
         self.assertEqual(requests.head.call_count, 1)
 
-        # without history
-        requests.head.reset_mock()
-        params.pop('tool_option')
+    @with_wiki
+    @patch('forgeimporters.github.requests')
+    @patch('forgeimporters.base.import_tool')
+    def test_create_without_history(self, import_tool, requests):
+        requests.head.return_value.status_code = 200
+        params = dict(
+            gh_user_name='spooky',
+            gh_project_name='mulder',
+            mount_point='gh-wiki',
+            mount_label='GitHub Wiki'
+        )
         r = self.app.post(self.url + 'create', params, status=302)
         self.assertEqual(r.location, 'http://localhost/p/%s/admin/' %
                          test_project_with_wiki)


Mime
View raw message