'Test that anonymous users are notified of new answers.'

@override_settings(TIDINGS_CONFIRM_ANONYMOUS_WATCHES=False)
def test_notify_anonymous(self):

    ANON_EMAIL = 'anonymous@example.com'
    QuestionReplyEvent.notify(ANON_EMAIL, self.question)
    self.makeAnswer()
    eq_(2, len(mail.outbox))
    notification = [m for m in mail.outbox if (m.to == [ANON_EMAIL])][0]
    eq_([ANON_EMAIL], notification.to)
    eq_(u'Re:    {0}'.format(self.question.title), notification.subject)
    body = re.sub('auth=[a-zA-Z0-9%_-]+', 'auth=AUTH', notification.body)
    starts_with(body, ANSWER_EMAIL_TO_ANONYMOUS.format(**self.format_args()))
