def test_duplicate_project(user_f): project_controller.create('BasicApplication', user_f) with pytest.raises(ApiException) as e: project_controller.create('BasicApplication', user_f) assert e.value.code == 403 assert e.value.reason == error_codes.PROJECT_EXISTS
def test_project_by_hash(app, user_f): project1 = project_controller.create('BasicApplication', user_f) # we commit so we get an id for the project db.session.commit() pid, project = project_controller.get_project(app.extensions['hasher'].encode(project1.id)) assert pid assert project assert project == project1
def create_project(): return jsonify(project_serializer.dump(project_controller.create(request.json['name'], current_user)).data)
def test_duplicate_project_name_different_owners(user_f, user2_f): project1 = project_controller.create('BasicApplication', user_f) project2 = project_controller.create('BasicApplication', user2_f) assert project1 and project2
def test_basic_project(user_f): project = project_controller.create('BasicApplication', user_f) assert project assert project.owner == user_f assert project.create_date