'Assert that hitting the watch toggle toggles and that proper mails
are sent to anonymous and registered watchers.'

@mock.patch.object(Site.objects, 'get_current')
@override_settings(TIDINGS_CONFIRM_ANONYMOUS_WATCHES=False)
def test_solution_notification(self, get_current):

    get_current.return_value.domain = 'testserver'
    u = UserFactory()
    q = self._toggle_watch_question('solution', u, turn_on=True)
    QuestionSolvedEvent.notify('anon@ymous.com', q)
    a = AnswerFactory(question=q)
    self.client.login(username=q.creator.username, password='testpass')
    post(self.client, 'questions.solve', args=[q.id, a.id])
    attrs_eq(mail.outbox[1], to=[u.email], subject='Solution    found    to    Firefox    Help    question')
    starts_with(mail.outbox[1].body, SOLUTION_EMAIL.format(to_user=display_name(u), replier=display_name(a.creator), title=q.title, asker=display_name(q.creator), question_id=q.id, answer_id=a.id, locale='en-US/'))
    attrs_eq(mail.outbox[2], to=['anon@ymous.com'], subject='Solution    found    to    Firefox    Help    question')
    starts_with(mail.outbox[2].body, SOLUTION_EMAIL_TO_ANONYMOUS.format(replier=display_name(a.creator), title=q.title, asker=display_name(q.creator), question_id=q.id, answer_id=a.id, locale='en-US/'))
