コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
ファイル: project_api.py プロジェクト: scooterman/middleman
def create_project():
    return jsonify(project_serializer.dump(project_controller.create(request.json['name'], current_user)).data)
コード例 #4
0
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
コード例 #5
0
def test_basic_project(user_f):
    project = project_controller.create('BasicApplication', user_f)

    assert project
    assert project.owner == user_f
    assert project.create_date