~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/answers/tests/test_question_notifications.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-07-19 21:36:17 UTC
  • mfrom: (11149.3.1 test-cruft-answers)
  • Revision ID: launchpad@pqm.canonical.com-20100719213617-4fftjam04tzxinox
[r=lifeless][ui=none] Test cruft in Answers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2010 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
""" Unit-tests for the Answer Tracker Mail Notifications. """
5
5
 
6
6
__metaclass__ = type
7
7
 
8
 
from unittest import TestCase, TestLoader
 
8
from unittest import TestCase
9
9
 
10
10
from zope.interface import implements
11
11
 
48
48
    """A fake user."""
49
49
    implements(IPerson)
50
50
 
 
51
 
51
52
class FakeEvent:
52
53
    """A fake event."""
53
54
    user = FakeUser()
62
63
            StubQuestion(), FakeEvent())
63
64
 
64
65
    def test_getSubject_no_new_message(self):
65
 
        """Test getSubject() when there is no message added to the question."""
 
66
        """getSubject() when there is no message added to the question."""
66
67
        self.assertEquals(
67
68
            '[Question #1]: Question title', self.notification.getSubject())
68
69
 
74
75
            self.notification.getSubject())
75
76
 
76
77
    def test_getSubject_new_message_with_reply_prefix(self):
77
 
        """Test getSubject() when there is a new message with a reply prefix."""
 
78
        """getSubject() when there is a new message with a reply prefix."""
78
79
        self.notification.new_message = StubQuestionMessage(
79
80
            'RE: Message subject')
80
81
        self.assertEquals('RE: [Question #1]: Message subject',
108
109
        self.assertEquals(
109
110
            'Re: [Question #1]: Message subject',
110
111
            self.notification.getSubject())
111
 
 
112
 
 
113
 
def test_suite():
114
 
    return TestLoader().loadTestsFromName(__name__)
115
 
 
116