incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [06/16] git commit: [#4701] ticket:540 Add current ticket's milestones to email notification
Date Thu, 27 Feb 2014 16:18:23 GMT
[#4701] ticket:540 Add current ticket's milestones to email notification


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

Branch: refs/heads/cj/7210
Commit: dfde920acca4396eb4da4f4d3c301809c86ae449
Parents: 63bd019
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Feb 21 15:58:01 2014 +0200
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Wed Feb 26 05:47:36 2014 +0000

----------------------------------------------------------------------
 Allura/allura/templates/mail/Ticket.txt         |  3 ++
 .../forgetracker/tests/functional/test_root.py  | 34 ++++++++++++++++++++
 2 files changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dfde920a/Allura/allura/templates/mail/Ticket.txt
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/mail/Ticket.txt b/Allura/allura/templates/mail/Ticket.txt
index 7c4c4da..64b704c 100644
--- a/Allura/allura/templates/mail/Ticket.txt
+++ b/Allura/allura/templates/mail/Ticket.txt
@@ -23,6 +23,9 @@
 ** [{{data.app_config.options.mount_point}}:#{{data.ticket_num}}] {{data.summary|e}}**
 
 **Status:** {{data.status}}
+{% for f in data.globals.milestone_fields -%}
+  **{{ f.label }}:** {{ data.custom_fields.get(f.name, '') }}
+{% endfor -%}
 {% if data.labels.__len__() -%}
     **Labels:** {% for label in data.labels %}{{label}} {% else %}None{% endfor %}
 {% endif -%}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dfde920a/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 b79a8e3..6a5fc02 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -1516,6 +1516,40 @@ class TestFunctionalController(TrackerTestController):
         assert_in('test second ticket', str(ticket_rows))
         assert_false('test third ticket' in str(ticket_rows))
 
+    def test_ticket_notification_contains_milestones(self):
+        params = dict(
+            custom_fields=[
+                dict(
+                    name='_releases',
+                    label='Releases',
+                    type='milestone',
+                    milestones=[{'name': '0.9.3'}, {'name': '1.0-beta'}],
+                    show_in_search='on',
+                ),
+                dict(
+                    name='_milestone',
+                    label='Milestone',
+                    type='milestone',
+                    milestones=[{'name': '1.0'}, {'name': '2.0'}],
+                    show_in_search='on',
+                ),
+            ],
+            open_status_names='aa bb',
+            closed_status_names='cc',
+        )
+        self.app.post(
+            '/admin/bugs/set_custom_fields',
+            params=variable_encode(params))
+        self.new_ticket(summary='test new milestone', _milestone='2.0',
+                        **{'custom_fields._releases': '1.0-beta'})
+        ThreadLocalORMSession.flush_all()
+        M.MonQTask.run_ready()
+        ThreadLocalORMSession.flush_all()
+        email = M.MonQTask.query.find(
+            dict(task_name='allura.tasks.mail_tasks.sendmail')).first()
+        assert_in('**Releases:** 1.0-beta', email.kwargs.text)
+        assert_in('**Milestone:** 2.0', email.kwargs.text)
+
     def test_bulk_edit_notifications(self):
         self.new_ticket(summary='test first ticket',
                         status='open', _milestone='2.0')


Mime
View raw message