def test_newsletter_expander(self): user = create_user() pn = Actions.newsletter(user) notifications = expander.expand(pn) self.assertEqual(len(notifications), 1) notification = notifications.pop() self.assertEqual(notification.recipient, user)
def test_newsletter_expander_for_user_with_no_email(self): user = create_user(email="") pn = Actions.newsletter(user) self.assertFalse(user.email) notifications = expander.expand(pn) self.assertEqual(len(notifications), 0)