allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [10/38] git commit: [#4019] ticket:481 Fix test
Date Wed, 30 Apr 2014 18:15:42 GMT
[#4019] ticket:481 Fix test


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

Branch: refs/heads/master
Commit: 7a39ef8b970ca541ebe3b71e46d3a1b586592f1d
Parents: 3effe7b
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Dec 20 11:22:42 2013 +0200
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Apr 30 15:55:10 2014 +0000

----------------------------------------------------------------------
 Allura/allura/lib/solr.py                               |  1 +
 ForgeTracker/forgetracker/tests/functional/test_root.py | 12 ++++++------
 .../forgetracker/tests/unit/test_root_controller.py     |  1 +
 3 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/7a39ef8b/Allura/allura/lib/solr.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/solr.py b/Allura/allura/lib/solr.py
index df7cd4d..23ae556 100644
--- a/Allura/allura/lib/solr.py
+++ b/Allura/allura/lib/solr.py
@@ -114,6 +114,7 @@ class MockSOLR(object):
         pass
 
     def search(self, q, fq=None, **kw):
+        if q is None: q = ''  # shlex will hang on None
         if isinstance(q, unicode):
             q = q.encode('latin-1')
         # Parse query

http://git-wip-us.apache.org/repos/asf/allura/blob/7a39ef8b/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 00ea90d..3efab34 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -1478,8 +1478,8 @@ class TestFunctionalController(TrackerTestController):
             'table', {'class': 'ticket-list'}).find('tbody')
         assert_in('test first ticket', str(ticket_rows))
         assert_in('test second ticket', str(ticket_rows))
-        edit_link = response.html.find('a', {'title': 'Bulk Edit'})
-        expected_link = "/p/test/bugs/edit/?q=%21status%3Awont-fix+%26%26+%21status%3Aclosed&sort=snippet_s+asc&limit=25&page=0"
+        edit_link = response.html.find('a',{'title':'Bulk Edit'})
+        expected_link = "/p/test/bugs/edit/?q=%21status%3Awont-fix+%26%26+%21status%3Aclosed&sort=snippet_s+asc&limit=25&filter=&page=0"
         assert_equal(expected_link, edit_link['href'])
         response = self.app.get(edit_link['href'])
         ticket_rows = response.html.find('tbody', {'class': 'ticket-list'})
@@ -1503,8 +1503,8 @@ class TestFunctionalController(TrackerTestController):
         assert_in('test first ticket', str(ticket_rows))
         assert_in('test second ticket', str(ticket_rows))
         assert_in('test third ticket', str(ticket_rows))
-        edit_link = response.html.find('a', {'title': 'Bulk Edit'})
-        expected_link = "/p/test/bugs/edit/?q=_milestone%3A1.0&sort=ticket_num_i+asc&limit=25&page=0"
+        edit_link = response.html.find('a',{'title':'Bulk Edit'})
+        expected_link = "/p/test/bugs/edit/?q=_milestone%3A1.0&sort=ticket_num_i+asc&limit=25&filter=&page=0"
         assert_equal(expected_link, edit_link['href'])
         response = self.app.get(edit_link['href'])
         ticket_rows = response.html.find('tbody', {'class': 'ticket-list'})
@@ -1526,8 +1526,8 @@ class TestFunctionalController(TrackerTestController):
         assert_in('test first ticket', str(ticket_rows))
         assert_in('test second ticket', str(ticket_rows))
         assert_false('test third ticket' in str(ticket_rows))
-        edit_link = response.html.find('a', {'title': 'Bulk Edit'})
-        expected_link = "/p/test/bugs/edit/?q=status%3Aopen&limit=25&page=0"
+        edit_link = response.html.find('a',{'title':'Bulk Edit'})
+        expected_link = "/p/test/bugs/edit/?q=status%3Aopen&limit=25&filter=%7B%7D&page=0"
         assert_equal(expected_link, edit_link['href'])
         response = self.app.get(edit_link['href'])
         ticket_rows = response.html.find('tbody', {'class': 'ticket-list'})

http://git-wip-us.apache.org/repos/asf/allura/blob/7a39ef8b/ForgeTracker/forgetracker/tests/unit/test_root_controller.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_root_controller.py b/ForgeTracker/forgetracker/tests/unit/test_root_controller.py
index 256ba86..facc28c 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_root_controller.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_root_controller.py
@@ -69,6 +69,7 @@ def solr_search_returning_colors_are_wrong_ticket():
     search_artifact = Mock()
     matches = Mock()
     matches.docs = [dict(ticket_num_i=ticket.ticket_num)]
+    matches.facets = {'facet_fields': {}}
     search_artifact.return_value = matches
     return patch('forgetracker.model.ticket.search_artifact', search_artifact)
 


Mime
View raw message