def tearDown(self): """Delete test organisation, user and email domain.""" acc = SpokeEmailAccount(self.org_name, self.user_id) acc.delete(self.email_addr) user = SpokeUser(self.org_name) user.delete(self.first, self.last) dom = SpokeEmailDomain(self.org_name) dom.delete(self.email_dom) org = SpokeOrg() org.delete(self.org_name, self.org_children)
def test_delete_email_account(self): """Delete an email account; return empty results object.""" first = 'delete_email' last = 'account_test' user_id = first + last email_addr = first + last + '@' + self.email_dom user = SpokeUser(self.org_name) user.create(email_addr, first, last) acc = SpokeEmailAccount(self.org_name, user_id) acc.create(email_addr) newacc = SpokeEmailAccount(self.org_name, user_id) self.assertTrue(newacc.delete(email_addr)) user.delete(first, last)