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 2014/05/09 23:42:25 UTC

[05/18] git commit: [#7257] ticket:562 Fixed index tests

[#7257] ticket:562 Fixed index tests


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

Branch: refs/heads/db/7257
Commit: 440220e69b932a2f34004194ea18ae80f5aace7f
Parents: af67f55
Author: Ferens Dmitriy <fe...@gmail.com>
Authored: Mon Apr 14 16:16:02 2014 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 9 18:56:47 2014 +0000

----------------------------------------------------------------------
 Allura/allura/model/session.py                    | 6 +++---
 ForgeBlog/forgeblog/tests/functional/test_root.py | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/440220e6/Allura/allura/model/session.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/session.py b/Allura/allura/model/session.py
index 9cec981..0feb938 100644
--- a/Allura/allura/model/session.py
+++ b/Allura/allura/model/session.py
@@ -85,7 +85,6 @@ class IndexerSessionExtension(ManagedSessionExtension):
             except:
                 log.error('Error calling %s', task.__name__)
 
-
     def after_flush(self, obj=None):
         actions = [
             ((self.objects_added + self.objects_modified), 'add'),
@@ -95,8 +94,9 @@ class IndexerSessionExtension(ManagedSessionExtension):
             if obj_list:
                 types_objects_map = self._objects_by_types(obj_list)
                 for class_path, obj_list in types_objects_map.iteritems():
-                    tasks = self.TASKS.get(class_path, {})
-                    self._index_action(tasks, obj_list, action)
+                    tasks = self.TASKS.get(class_path)
+                    if tasks:
+                        self._index_action(tasks, obj_list, action)
 
         super(IndexerSessionExtension, self).after_flush(obj)
 

http://git-wip-us.apache.org/repos/asf/allura/blob/440220e6/ForgeBlog/forgeblog/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/tests/functional/test_root.py b/ForgeBlog/forgeblog/tests/functional/test_root.py
index 63bbb8c..6bc530e 100644
--- a/ForgeBlog/forgeblog/tests/functional/test_root.py
+++ b/ForgeBlog/forgeblog/tests/functional/test_root.py
@@ -215,6 +215,7 @@ class Test(TestController):
 
     def test_related_artifacts(self):
         self._post(title='one')
+        M.MonQTask.run_ready()
         d = self._blog_date()
         self._post(title='two', text='[blog:%s/one]' % d)
         M.MonQTask.run_ready()