=== modified file 'lib/lp/bugs/mail/tests/test_bug_task_assignment.py' --- lib/lp/bugs/mail/tests/test_bug_task_assignment.py 2010-06-21 18:09:47 +0000 +++ lib/lp/bugs/mail/tests/test_bug_task_assignment.py 2010-06-21 18:10:23 +0000 @@ -68,6 +68,19 @@ msg = stub.test_emails[-1][2] self.assertTrue(rationale in msg, '%s not in\n%s\n' % (rationale, msg)) + def test_assignee_is_assigner_notification_message(self): + """Test that the string is different if someone assigns themselves a bug task.""" + self.assertEqual(len(stub.test_emails), 0, 'emails in queue') + self.bug_task.transitionToAssignee(self.person_assigned) + notify(ObjectModifiedEvent( + self.bug_task, self.bug_task_before_modification, + ['assignee'], user=self.user)) + transaction.commit() + self.assertEqual(len(stub.test_emails), 1, 'email not sent') + rationale = 'You have assigned yourself a bug task for a public bug' + msg = stub.test_emails[-1][2] + self.assertTrue(rationale in msg, '%s not in\n%s\n' % (rationale, msg)) + def test_assignee_not_a_subscriber(self): """Test that a new recipient being assigned a bug task does send a NEW message.""" self.assertEqual(len(stub.test_emails), 0, 'emails in queue')