allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [16/26] git commit: [#7656] ticket:648 Fix test failing due to refactoring
Date Fri, 19 Sep 2014 20:04:30 GMT
[#7656] ticket:648 Fix test failing due to refactoring


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

Branch: refs/heads/master
Commit: 2ff64b83cdd9f2033a0182724228cf06f872ed81
Parents: 0f6a2d6
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Sep 9 16:29:25 2014 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Sep 19 19:35:40 2014 +0000

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_site_admin.py | 4 ++--
 Allura/allura/tests/model/test_auth.py            | 2 +-
 Allura/allura/tests/unit/test_solr.py             | 9 +++++----
 3 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/2ff64b83/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 b7ae16a..9503b7e 100644
--- a/Allura/allura/tests/functional/test_site_admin.py
+++ b/Allura/allura/tests/functional/test_site_admin.py
@@ -244,7 +244,7 @@ class TestProjectsSearch(TestController):
 
     @patch('allura.controllers.site_admin.search')
     def test_default_fields(self, search):
-        search.search_projects.return_value = self.TEST_HIT
+        search.site_admin_search.return_value = self.TEST_HIT
         r = self.app.get('/nf/admin/search_projects?q=fake&f=shortname')
         options = [o['value'] for o in r.html.findAll('option')]
         assert_equal(options, ['shortname', 'name', '__custom__'])
@@ -253,7 +253,7 @@ class TestProjectsSearch(TestController):
 
     @patch('allura.controllers.site_admin.search')
     def test_additional_fields(self, search):
-        search.search_projects.return_value = self.TEST_HIT
+        search.site_admin_search.return_value = self.TEST_HIT
         with h.push_config(config, **{'search.project.additional_fields': 'private, url'}):
             r = self.app.get('/nf/admin/search_projects?q=fake&f=shortname')
         options = [o['value'] for o in r.html.findAll('option')]

http://git-wip-us.apache.org/repos/asf/allura/blob/2ff64b83/Allura/allura/tests/model/test_auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_auth.py b/Allura/allura/tests/model/test_auth.py
index 4660510..75cf5a2 100644
--- a/Allura/allura/tests/model/test_auth.py
+++ b/Allura/allura/tests/model/test_auth.py
@@ -295,7 +295,7 @@ def test_user_index():
     assert_in('results_per_page_i', idx)
     assert_in('email_format_s', idx)
     assert_in('disable_user_messages_b', idx)
-    assert_equal(idx['display_name_s'], 'Test Admin')
+    assert_equal(idx['display_name_t'], 'Test Admin')
     assert_equal(idx['sex_s'], 'Unknown')
     assert_in('birthdate_dt', idx)
     assert_in('localization_s', idx)

http://git-wip-us.apache.org/repos/asf/allura/blob/2ff64b83/Allura/allura/tests/unit/test_solr.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/test_solr.py b/Allura/allura/tests/unit/test_solr.py
index 7e104d1..8b237cc 100644
--- a/Allura/allura/tests/unit/test_solr.py
+++ b/Allura/allura/tests/unit/test_solr.py
@@ -92,15 +92,16 @@ class TestSolr(unittest.TestCase):
         solr.query_server.search.assert_called_once_with('bar', kw='kw')
 
     @mock.patch('allura.lib.search.search')
-    def test_search_projects(self, search):
-        from allura.lib.search import search_projects
+    def test_site_admin_search(self, search):
+        from allura.lib.search import site_admin_search
+        from allura.model import Project
         fq = ['type_s:Project']
-        search_projects('test', 'shortname', rows=25)
+        site_admin_search(Project, 'test', 'shortname', rows=25)
         search.assert_called_once_with(
             'shortname_s:"test"', fq=fq, ignore_errors=False, rows=25)
 
         search.reset_mock()
-        search_projects('shortname:test || shortname:test2', '__custom__')
+        site_admin_search(Project, 'shortname:test || shortname:test2', '__custom__')
         search.assert_called_once_with(
             'shortname_s:test || shortname_s:test2', fq=fq, ignore_errors=False)
 


Mime
View raw message