allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [2/2] git commit: [#7278] ticket:612 Fix tests
Date Tue, 05 Aug 2014 09:03:06 GMT
[#7278] ticket:612 Fix tests


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

Branch: refs/heads/je/42cc_7278
Commit: fa502f3ccd6a59e0fd7f1cbfee605a7235d92466
Parents: c3fee48
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Aug 5 08:38:51 2014 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Tue Aug 5 08:38:51 2014 +0000

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_site_admin.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/fa502f3c/Allura/allura/tests/functional/test_site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_site_admin.py b/Allura/allura/tests/functional/test_site_admin.py
index bb59c75..e99f2e4 100644
--- a/Allura/allura/tests/functional/test_site_admin.py
+++ b/Allura/allura/tests/functional/test_site_admin.py
@@ -22,6 +22,7 @@ from nose.tools import assert_equal, assert_in, assert_not_in
 from ming.odm import ThreadLocalORMSession
 from pylons import tmpl_context as c
 from tg import config
+from bson import ObjectId
 
 from allura import model as M
 from allura.tests import TestController
@@ -202,6 +203,18 @@ class TestProjectsSearch(TestController):
         'id': 'allura/model/project/Project#53ccf6e8100d2b0741746e9f',
     }])
 
+    def setUp(self):
+        super(TestProjectsSearch, self).setUp()
+        # Create project that matches TEST_HIT id
+        p = M.Project.query.get(_id=ObjectId('53ccf6e8100d2b0741746e9f'))
+        if not p:
+            M.Project(
+                _id=ObjectId('53ccf6e8100d2b0741746e9f'),
+                neighborhood_id=M.Neighborhood.query.get(url_prefix='/u/')._id,
+                shortname='test-project',
+            )
+            ThreadLocalORMSession().flush_all()
+
     @patch('allura.controllers.site_admin.search')
     def test_default_fields(self, search):
         search.search_projects.return_value = self.TEST_HIT


Mime
View raw message