def add_no_email_test(self): self.assertEqual( 0, len(self.retrieve_draw().users) ) self.req.GET = {"draw_id": self.test_draw._id} add_user_to_draw(self.req) self.assertEqual( 0, len(self.retrieve_draw().users) )
def add_only_one_valid_test(self): self.assertEqual( 0, len(self.retrieve_draw().users) ) self.req.GET = { "draw_id": self.test_draw._id, "emails": "this_is_not_an_email [email protected]" } add_user_to_draw(self.req) self.assertEqual( 0, len(self.retrieve_draw().users) )
def add_two_email_test(self): self.assertEqual( 0, len(self.retrieve_draw().users) ) self.req.GET = { "draw_id": self.test_draw._id, "emails": "[email protected], [email protected]" } add_user_to_draw(self.req) self.assertEqual( 2, len(self.retrieve_draw().users) )