Example #1
0
def test_submit_year(get_csrf_request_with_db):
    req = get_csrf_request_with_db()
    req.GET = {'year': '2010'}
    view = DisplayCommercialHandling(None, req)
    assert view.submit_year() == {'year': 2010}
    req.GET = {}
    assert view.submit_year() == {'year': date.today().year}
Example #2
0
def test_submit_year(get_csrf_request_with_db):
    req = get_csrf_request_with_db()
    req.GET = {'year':'2010'}
    view = DisplayCommercialHandling(None, req)
    assert view.submit_year() == {'year':2010}
    req.GET = {}
    assert view.submit_year() == {'year': date.today().year}
Example #3
0
def test_edit(proj, get_csrf_request_with_db):
    appstruct = APPSTRUCT.copy()
    appstruct['value'] = 10
    req = get_csrf_request_with_db()
    view = DisplayCommercialHandling(None, req)
    view.submit_success(appstruct)
    proj = getOne()
    assert proj.value == 10
Example #4
0
def test_edit(proj, get_csrf_request_with_db):
    appstruct = APPSTRUCT.copy()
    appstruct['value'] = 10
    req = get_csrf_request_with_db()
    view = DisplayCommercialHandling(None, req)
    view.submit_success(appstruct)
    proj = getOne()
    assert proj.value == 10
Example #5
0
def proj(request, config, get_csrf_request_with_db):
    config.add_route('commercial_handling', '/')
    req = get_csrf_request_with_db()
    req.context = Mock(id=1)
    # On utilise la docstring pour stocker des paramètres, c sal mais ça marche
    year = request.function.__doc__
    if year:
        req.GET = {'year': year}
    view = DisplayCommercialHandling(None, req)
    view.submit_success(APPSTRUCT)
    return getOne()
Example #6
0
def proj(request, config, get_csrf_request_with_db):
    config.add_route('commercial_handling', '/')
    req = get_csrf_request_with_db()
    req.context = Mock(id=1)
    # On utilise la docstring pour stocker des paramètres, c sal mais ça marche
    year = request.function.__doc__
    if year:
        req.GET = {'year':year}
    view = DisplayCommercialHandling(None, req)
    view.submit_success(APPSTRUCT)
    return getOne()