Exemple #1
0
def test_addphase(config, dbsession, project, get_csrf_request_with_db):
    from autonomie.views.project import PhaseAddFormView
    from autonomie.models.project import Phase
    config.add_route('project/{id}', '/')
    req = get_csrf_request_with_db()
    req.context = project
    view = PhaseAddFormView(req)
    view.submit_success({'name': u'Phasé'})
    dbsession.flush()
    phases = Phase.query().filter(Phase.project == project).all()
    assert (len(phases) == 2)
Exemple #2
0
def test_addphase(config, dbsession, project, get_csrf_request_with_db):
    from autonomie.views.project import PhaseAddFormView
    from autonomie.models.project import Phase
    config.add_route('project/{id}', '/')
    req = get_csrf_request_with_db()
    req.context = project
    view = PhaseAddFormView(req)
    view.submit_success({'name': u'Phasé'})
    dbsession.flush()
    phases = Phase.query().filter(Phase.project==project).all()
    assert(len(phases) == 2)
Exemple #3
0
def get_all_phases(request):
    project_ids = [p.id for p in get_all_projects(request)]
    return Phase.query().filter(Phase.project_id.in_(project_ids)).all()
def phase(content):
    return Phase.query().first()
Exemple #5
0
def phase(content):
    return Phase.query().first()
def get_all_phases(request):
    project_ids = [p.id for p in get_all_projects(request)]
    return Phase.query().filter(Phase.project_id.in_(project_ids)).all()