Ejemplo n.º 1
0
def test_customer_remove(project, get_csrf_request_with_db):
    from autonomie.views.project import ProjectEdit
    req = get_csrf_request_with_db()
    req.context = project
    appstruct = APPSTRUCT.copy()
    appstruct["customers"] = []
    view = ProjectEdit(req)
    view.submit_success(appstruct)
    project = getone()
    assert (len(project.customers) == 0)
Ejemplo n.º 2
0
def test_edit(project, get_csrf_request_with_db):
    from autonomie.views.project import ProjectEdit
    req = get_csrf_request_with_db()
    req.context = project
    appstruct = APPSTRUCT.copy()
    definition = u"Super project, should e ^dmeù*"
    appstruct['definition'] = definition
    view = ProjectEdit(req)
    view.submit_success(appstruct)
    project = getone()
    assert (project.definition == definition)
Ejemplo n.º 3
0
def test_customer_remove(config, get_csrf_request_with_db, project):
    assert len(project.customers) == 1
    from autonomie.views.project import ProjectEdit
    config.add_route('project', '/')
    req = get_csrf_request_with_db()
    req.context = project
    appstruct = {'name': project.name, "code": project.code, "customers": []}
    view = ProjectEdit(req)
    view.submit_success(appstruct)

    project = getone()
    assert (len(project.customers) == 0)
Ejemplo n.º 4
0
def test_edit(config, get_csrf_request_with_db, customer, project):
    from autonomie.views.project import ProjectEdit
    config.add_route('project', '/')
    req = get_csrf_request_with_db()
    req.context = project
    definition = u"Super project, should e ^dmeù*"
    appstruct = {
        'name': u'Projéct&$',
        "code": "ABDC",
        "customers": [customer.id],
        'definition': definition
    }
    view = ProjectEdit(req)
    view.submit_success(appstruct)

    project = getone()
    assert (project.definition == definition)