'We provide one-click unsubscribe links in welcome e-mails that you can
click even when logged out to stop receiving them.'

def test_welcome_unsubscribe(self):

    user_profile = self.example_user('hamlet')
    enqueue_welcome_emails(user_profile.id)
    self.assertEqual(2, ScheduledEmail.objects.filter(user=user_profile).count())
    unsubscribe_link = one_click_unsubscribe_link(user_profile, 'welcome')
    result = self.client_get(urllib.parse.urlparse(unsubscribe_link).path)
    self.assertEqual(result.status_code, 200)
    self.assertEqual(0, ScheduledEmail.objects.filter(user=user_profile).count())
