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/06/26 15:38:22 UTC
git commit: [#7492] corrected activity description not to display
'on' in case there is no activity name
Repository: allura
Updated Branches:
refs/heads/master ac759c500 -> 4ee0a8c43
[#7492] corrected activity description not to display 'on' in case there is no activity name
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/4ee0a8c4
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/4ee0a8c4
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/4ee0a8c4
Branch: refs/heads/master
Commit: 4ee0a8c437ec831bcb45fd49c22387eea7786205
Parents: ac759c5
Author: Alexander Luberg <al...@slashdotmedia.com>
Authored: Wed Jun 25 11:59:09 2014 -0700
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Jun 26 13:38:06 2014 +0000
----------------------------------------------------------------------
ForgeActivity/forgeactivity/main.py | 2 +-
.../forgeactivity/tests/functional/test_root.py | 24 ++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/4ee0a8c4/ForgeActivity/forgeactivity/main.py
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/main.py b/ForgeActivity/forgeactivity/main.py
index 37c7ff5..e0b22c8 100644
--- a/ForgeActivity/forgeactivity/main.py
+++ b/ForgeActivity/forgeactivity/main.py
@@ -164,7 +164,7 @@ class ForgeActivityController(BaseController):
t.actor.activity_name,
t.verb,
t.obj.activity_name,
- ' on %s' % (t.target.activity_name or ''),
+ ' on %s' % t.target.activity_name if t.target.activity_name else '',
),
link=url,
pubdate=t.published,
http://git-wip-us.apache.org/repos/asf/allura/blob/4ee0a8c4/ForgeActivity/forgeactivity/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/tests/functional/test_root.py b/ForgeActivity/forgeactivity/tests/functional/test_root.py
index a2b3d55..240ed7d 100644
--- a/ForgeActivity/forgeactivity/tests/functional/test_root.py
+++ b/ForgeActivity/forgeactivity/tests/functional/test_root.py
@@ -226,6 +226,30 @@ class TestActivityController(TestController):
assert_equal(activity.find('link').text,
'http://localhost/p/test/tickets/34/?limit=25#ed7c')
+ @td.with_tool('test', 'activity')
+ @patch('forgeactivity.main.g.director')
+ def test_feed_rss_project_verb_without_activity_name(self, director):
+ from activitystream.storage.base import StoredActivity
+ director.get_timeline.return_value = [StoredActivity(**{
+ "obj": {
+ "activity_extras": {},
+ "activity_url": "/p/test/tickets/34/?limit=25#ed7c",
+ "activity_name": "ticket #34"
+ },
+ "target": {},
+ "actor": {
+ "activity_name": "Administrator 1",
+ },
+ "verb": "created"
+ })]
+
+ r = self.app.get('/p/test/activity/feed.rss')
+ timeline = r.xml.find('channel')
+ assert_equal(1, len(timeline.findall('item')))
+ activity = timeline.find('item')
+
+ assert_equal(activity.find('title').text, 'Administrator 1 created ticket #34')
+
@td.with_tool('u/test-user-1', 'activity')
@td.with_user_project('test-user-1')
@patch('forgeactivity.main.g.director')