def setUp(self): Account.default_adapter = MockAdapter self.mailing = Mailing( Account(account_id="100", public_key="xxx", private_key="yyy"), { 'mailing_id': 200, 'delivery_ts': datetime.now().strftime(SERIALIZED_DATETIME_FORMAT), 'clicked': None, 'opened': None, 'forwarded': None, 'shared': None, 'sent': datetime.now().strftime(SERIALIZED_DATETIME_FORMAT) })
def setUp(self): Account.default_adapter = MockAdapter self.messages = Mailing( Account(account_id="100", public_key="xxx", private_key="yyy"), { 'mailing_id': 200 }).messages
def test_fetch_all_returns_a_dictionary(self): mailing = Mailing(self.members.mailing.account) members = MailingMemberCollection(mailing) with self.assertRaises(ex.NoMailingIdError): members.fetch_all() self.assertEquals(members.mailing.account.adapter.called, 0)
def test_fetch_all_returns_a_dictionary(self): mailing = Mailing(self.groups.mailing.account) groups = MailingGroupCollection(mailing) with self.assertRaises(ex.NoMailingIdError): groups.fetch_all() self.assertEquals(groups.mailing.account.adapter.called, 0)