incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [44/44] git commit: [#5116] ticket:197 added summary, date, description to the feed
Date Tue, 27 Nov 2012 13:46:07 GMT
[#5116] ticket:197 added summary, date, description to the feed


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

Branch: refs/heads/cj/4691
Commit: a0df1d348e92e5e2c4df9755f3716d7593b453d0
Parents: e8fad3c
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Fri Nov 2 13:50:10 2012 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Mon Nov 5 18:14:37 2012 +0000

----------------------------------------------------------------------
 Allura/allura/model/artifact.py                    |    2 +-
 ForgeTracker/forgetracker/model/ticket.py          |    7 ++++-
 .../forgetracker/tests/functional/test_root.py     |   10 +++++++
 .../forgetracker/tests/unit/test_ticket_model.py   |   21 ++++++++++++++-
 4 files changed, 37 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a0df1d34/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 752ecb4..3d71aaa 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -650,8 +650,8 @@ class Feed(MappedClass):
             title=title,
             description=description,
             link=artifact.url(),
-            author_name=author_name,
             pubdate=pubdate,
+            author_name=author_name,
             author_link=author_link or author.url())
         return item
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a0df1d34/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index b65d0f8..ec3093c 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -443,7 +443,12 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
             n = Notification.post(artifact=self, topic='metadata', text=description, subject=subject)
             if monitoring_email and n:
                 n.send_simple(monitoring_email)
-        Feed.post(self, description)
+        Feed.post(
+            self,
+            title=self.summary,
+            description=description if description else self.description,
+            author=self.reported_by,
+            pubdate=self.created_date)
 
     def url(self):
         return self.app_config.url() + str(self.ticket_num) + '/'

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a0df1d34/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 1ac0f7f..10a6479 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -672,6 +672,16 @@ class TestFunctionalController(TrackerTestController):
         response = self.app.get('/p/test/bugs/search_feed.atom?q=test')
         assert '<title>test first ticket</title>' in response
 
+    def test_feed(self):
+        self.new_ticket(
+            summary='test first ticket',
+            description='test description')
+        ThreadLocalORMSession.flush_all()
+        M.MonQTask.run_ready()
+        ThreadLocalORMSession.flush_all()
+        response = self.app.get('/p/test/bugs/feed')
+        assert 'test first ticket' in response
+
     def test_touch(self):
         self.new_ticket(summary='test touch')
         h.set_context('test', 'bugs', neighborhood='Projects')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a0df1d34/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
index 05b5657..a66ef9a 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
@@ -1,11 +1,13 @@
 from pylons import c
+from datetime import datetime
 
 from ming.orm.ormsession import ThreadLocalORMSession
 from ming import schema
-from nose.tools import raises, assert_raises
+from nose.tools import raises, assert_raises, assert_equal
 
 from forgetracker.model import Ticket
 from forgetracker.tests.unit import TrackerTestWithModel
+from allura.model import Feed
 
 
 class TestTicketModel(TrackerTestWithModel):
@@ -109,3 +111,20 @@ class TestTicketModel(TrackerTestWithModel):
         assert not has_access(t, 'update', user=creator)()
         assert has_access(t, 'read', user=observer)()
         assert has_access(t, 'read', user=anon)()
+
+    def test_feed(self):
+        t = Ticket(
+        app_config_id=c.app.config._id,
+        ticket_num=1,
+        summary='test ticket',
+        description='test description',
+        created_date=datetime(2012, 10, 29, 9, 57, 21, 465000))
+        assert_equal(t.created_date, datetime(2012, 10, 29, 9, 57, 21, 465000))
+        f = Feed.post(
+            t,
+            title=t.summary,
+            description=t.description,
+            pubdate=t.created_date)
+        assert_equal(f.pubdate, datetime(2012, 10, 29, 9, 57, 21, 465000))
+        assert_equal(f.title, 'test ticket')
+        assert_equal(f.description, 'test description')


Mime
View raw message