def test_cant_find_project(self): project_list = [ Project({"id": "111111", "public": "true", "name":"Test Project 1"}), Project({"id": "222222", "public": "false", "name":"Test Project 2"}), Project({"id": "666666", "public": "false", "name":"Test Project 3"})] project_found = find_project(project_list,'999999') self.assertEqual(project_found, None)
def project(project_id): current_user = flask_helper.safe_session("user_id") project_list = _get_filtered_projects() project_found = find_project(project_list, str(project_id)) if project_found == None: return redirect(url_for("overview")) project_id = str(project_id) burndown = Burndown(project_id, localdata.getBurndownStates(project_id)) labels = burndown_labels(burndown) possible_states = config.states("tracker") return render_template("project.html", project=project_found, labels=labels, states=possible_states)