81
81
"body -- mdash\n-- \nrationale", formatted_body)
83
def test_getSubject_no_new_message(self):
83
def test_getSubject(self):
84
84
"""getSubject() when there is no message added to the question."""
86
'[Question #1]: Question title', self.notification.getSubject())
88
def test_getSubject_new_message(self):
89
"""Test getSubject() when there is a new message."""
90
self.notification.new_message = StubQuestionMessage()
92
'[Question #1]: Message subject',
93
self.notification.getSubject())
95
def test_getSubject_new_message_with_reply_prefix(self):
96
"""getSubject() when there is a new message with a reply prefix."""
97
self.notification.new_message = StubQuestionMessage(
98
'RE: Message subject')
99
self.assertEquals('RE: [Question #1]: Message subject',
100
self.notification.getSubject())
102
self.notification.new_message.subject = 'Re: Message subject'
103
self.assertEquals('Re: [Question #1]: Message subject',
104
self.notification.getSubject())
106
self.notification.new_message.subject = 're: Message subject'
107
self.assertEquals('re: [Question #1]: Message subject',
108
self.notification.getSubject())
110
def test_getSubject_with_existing_prefix(self):
111
"""Test getSubject() when there is already a [Question #xx] prefix."""
112
self.notification.new_message = StubQuestionMessage(
113
'[Question #1]: Question title')
114
self.assertEquals('[Question #1]: Question title',
115
self.notification.getSubject())
117
self.notification.new_message.subject = (
118
'Re: [Question #1]: Message subject')
120
'Re: [Question #1]: Message subject',
121
self.notification.getSubject())
123
def test_getSubject_old_prefix(self):
124
"""Test that getSubject() with an old [Support #dd] prefix."""
125
self.notification.new_message = StubQuestionMessage(
126
'Re: [Support #1]: Message subject')
128
'Re: [Question #1]: Message subject',
86
'Re: [Question #1]: Question title',
129
87
self.notification.getSubject())
131
89
def test_user_is_event_user(self):