allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#5726] Fixed an issue that prevented discussion rss feeds from updating.
Date Wed, 28 Jan 2015 15:20:16 GMT
Repository: allura
Updated Branches:
  refs/heads/master 5f96cdfb6 -> 852360fd5


[#5726] Fixed an issue that prevented discussion rss feeds from updating.


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

Branch: refs/heads/master
Commit: 852360fd558806c04ab545b018231945dcb39f9a
Parents: 5f96cdf
Author: Heith Seewald <hseewald@slashdotmedia.com>
Authored: Mon Jan 19 18:42:08 2015 -0500
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Jan 28 15:09:43 2015 +0000

----------------------------------------------------------------------
 Allura/allura/model/discuss.py                              | 2 +-
 .../controllers/test_discussion_moderation_controller.py    | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/852360fd/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 8ce86b2..581eb21 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -246,7 +246,7 @@ class Thread(Artifact, ActivityObject):
         return self.ref.artifact
 
     def post_to_feed(self, post):
-        if self.ref and post.status == 'ok':
+        if post.status == 'ok':
             link = None
             if self.app.tool_label.lower() == 'tickets':
                 link = post.url_paginated()

http://git-wip-us.apache.org/repos/asf/allura/blob/852360fd/Allura/allura/tests/unit/controllers/test_discussion_moderation_controller.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/controllers/test_discussion_moderation_controller.py
b/Allura/allura/tests/unit/controllers/test_discussion_moderation_controller.py
index e56f2bc..e6dc38d 100644
--- a/Allura/allura/tests/unit/controllers/test_discussion_moderation_controller.py
+++ b/Allura/allura/tests/unit/controllers/test_discussion_moderation_controller.py
@@ -16,7 +16,7 @@
 #       under the License.
 
 from nose.tools import assert_equal
-from mock import Mock
+from mock import Mock, patch
 from ming.orm import ThreadLocalORMSession
 
 from allura.tests.unit import WithDatabase
@@ -42,7 +42,12 @@ class TestWhenModerating(WithDatabase):
 
     def test_that_it_can_approve(self):
         mod_date = self.get_post().mod_date
-        self.moderate_post(approve=True)
+
+        with patch('allura.model.discuss.Thread.post_to_feed') as mock_post_to_feed:
+            self.moderate_post(approve=True)
+            assert mock_post_to_feed.called
+            assert mock_post_to_feed.call_count == 1
+
         post = self.get_post()
         assert_equal(post.status, 'ok')
         assert_equal(post.thread.last_post_date.strftime("%Y-%m-%d %H:%M:%S"),


Mime
View raw message