def tearDown(self): self.app_context.pop() User.drop_collection() Team.drop_collection() Project.drop_collection() Item.drop_collection() TodoList.drop_collection()
def get_initial_data(user): """Get initial data for the user Returns an object of: user -- user logged into Todo teams -- teams that the user is a member of, including projects that the user is a contributor of """ user = user_dict(user) teams = Team.get_teams_for_user(user) teams_list = [] for team in teams: teams_list.append(team_dict(team)) return {'user': user, 'teams': teams_list}