From 90c44a7c676d10428b11fc1f3c32c290a749530f Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Sat, 13 Feb 2010 21:44:26 +0000 Subject: [PATCH] test do not notify user when no sender is available. svn path=/plone.app.discussion/branches/notification/; revision=33964 --- .../app/discussion/tests/test_notifications.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plone/app/discussion/tests/test_notifications.py b/plone/app/discussion/tests/test_notifications.py index 281e3fe..d4b92d0 100644 --- a/plone/app/discussion/tests/test_notifications.py +++ b/plone/app/discussion/tests/test_notifications.py @@ -118,6 +118,24 @@ class TestUserNotificationUnit(PloneTestCase): self.assertEquals(len(self.mailhost.messages), 0) + def test_do_not_notify_user_when_no_sender_is_available(self): + # Set sender mail address to nonw and make sure no email is send to the + # moderator. + self.portal.email_from_address = None + + comment = createObject('plone.Comment') + comment.title = 'Comment 1' + comment.text = 'Comment text' + comment.author_notification = True + comment.author_email = "john@plone.test" + self.conversation.addComment(comment) + + comment = createObject('plone.Comment') + comment.title = 'Comment 2' + comment.text = 'Comment text' + self.conversation.addComment(comment) + + self.assertEquals(len(self.mailhost.messages), 0) class TestModeratorNotificationUnit(PloneTestCase):