def test_it_sends_test_email(self):
    self.client.login(username='example@example.com', password='password')
    r = self.client.post(self.url, {}, follow=True)
    self.assertRedirects(r, self.channels_url)
    self.assertContains(r, 'Test notification sent!')
    self.assertEqual(len(mail.outbox), 1)
    email = mail.outbox[0]
    self.assertEqual(email.to[0], 'example@example.com')
    self.assertTrue(('X-Bounce-Url' in email.extra_headers))
    self.assertTrue(('List-Unsubscribe' in email.extra_headers))
    n = Notification.objects.get()
    self.assertEqual(n.channel, self.channel)
    self.assertEqual(n.error, '')
def test_it_sends_test_email(self):
    self.client.login(username='example@example.com', password='password')
    r = self.client.post(self.url, {}, follow=True)
    self.assertRedirects(r, self.channels_url)
    self.assertContains(r, 'Test notification sent!')
    self.assertEqual(len(mail.outbox), 1)
    email = mail.outbox[0]
    self.assertEqual(email.to[0], 'example@example.com')
    self.assertTrue(('X-Bounce-Url' in email.extra_headers))
    self.assertTrue(('List-Unsubscribe' in email.extra_headers))
    n = Notification.objects.get()
    self.assertEqual(n.channel, self.channel)
    self.assertEqual(n.error, )