

@mock.patch.object(Site.objects, 'get_current')
def test_create_announcement(self, get_current):
    'An announcement is created and email is sent to group members.'
    get_current.return_value.domain = 'testserver'
    a = self._setup_announcement()
    eq_(2, len(mail.outbox))
    assert (a.content in mail.outbox[0].body)
    assert (a.content in mail.outbox[1].body)
    a.creator = self.user
    a.save()
    eq_(2, len(mail.outbox))

dataset/ETHPy150Open mozilla/kitsune/kitsune/announcements/tests/test_tasks.py AnnouncementSaveTests.test_create_announcement/original