def create_invites(request): # Not gonna use forms for this logger = logging.getLogger("create_invites") try: post = request.POST.copy() contact_ids = post.getlist("contact_id") # Make the invites... we're going to throw this list away tho invites = tools.make_invites(contact_ids) response = render_to_response("invited.xslt", RequestContext(request, {})) return response except Exception, e: logger.exception("whoops!")
def test_invite_create(self): """Test that invites can be created from a list of contact ids""" try: contact_ids = [contact["id"] for contact in self.imported_contacts] invites = make_invites(contact_ids) test_data = "|".join([d[0] for d in self.data_list]) invite_emails = "|".join([invite["email_to"] for invite in invites]) self.assertEquals( test_data, invite_emails, "invite emails are not the same as the test data: %s" % invite_emails ) finally: pass
def test_invite_create(self): """Test that invites can be created from a list of contact ids""" try: contact_ids = [contact["id"] for contact in self.imported_contacts] invites = make_invites(contact_ids) test_data = "|".join([d[0] for d in self.data_list]) invite_emails = "|".join( [invite["email_to"] for invite in invites]) self.assertEquals( test_data, invite_emails, "invite emails are not the same as the test data: %s" % invite_emails) finally: pass