incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [07/50] git commit: [#3153] ticket:389 finished tickets with posts export
Date Mon, 26 Aug 2013 14:00:46 GMT
[#3153] ticket:389 finished tickets with posts export


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

Branch: refs/heads/tv/6595
Commit: 208d57f23f7077fbd5453940743fb21fb8f7cf38
Parents: 21ed41e
Author: Anton Kasyanov <mind1master@gmail.com>
Authored: Tue Jul 23 17:39:23 2013 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Aug 22 20:04:41 2013 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/tests/test_app.py | 15 +++++++++++----
 ForgeTracker/forgetracker/tracker_main.py   |  1 +
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/208d57f2/ForgeTracker/forgetracker/tests/test_app.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/test_app.py b/ForgeTracker/forgetracker/tests/test_app.py
index 9c7e61e..e99948b 100644
--- a/ForgeTracker/forgetracker/tests/test_app.py
+++ b/ForgeTracker/forgetracker/tests/test_app.py
@@ -35,13 +35,20 @@ class TestBulkExport(TrackerTestController):
         self.project = M.Project.query.get(shortname='test')
         self.tracker = self.project.app_instance('bugs')
         self.new_ticket(summary='foo', _milestone='1.0')
+        self.new_ticket(summary='bar', _milestone='1.0')
+        ticket = TM.Ticket.query.find(dict(summary='foo')).first()
+        ticket.discussion_thread.add_post(text='silly comment')
 
     def test_bulk_export(self):
         f = tempfile.TemporaryFile()
         self.tracker.bulk_export(f)
         f.seek(0)
         tracker = json.loads(f.read())
-        #tickets = sorted(tracker['tickets'], key=operator.itemgetter('title'))
-        tickets = tracker['tickets']
-        print tickets
-        assert_equal(len(tickets), 1)
+        tickets = sorted(tracker['tickets'], key=operator.itemgetter('summary'))
+        assert_equal(len(tickets), 2)
+        ticket_foo = tickets[1]
+        assert_equal(ticket_foo['summary'], 'foo')                
+        assert_equal(ticket_foo['custom_fields']['_milestone'], '1.0')
+        posts_foo = ticket_foo['discussion_thread']['posts']
+        assert_equal(len(posts_foo), 1)
+        assert_equal(posts_foo[0]['text'], 'silly comment')                

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/208d57f2/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index ff540c3..4a622c5 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -206,6 +206,7 @@ class ForgeTrackerApp(Application):
             schema.OneOf('NewTicketsOnly', 'AllTicketChanges',
                 'NewPublicTicketsOnly', 'AllPublicTicketChanges'), None)
         ]
+    exportable = True
     searchable=True
     tool_label='Tickets'
     tool_description="""


Mime
View raw message