def test_rest_entry_edit(full_sheet, get_csrf_request_with_db):
    from autonomie.views.statistics import RestStatisticEntry
    appstruct = {
        "title": u"Entrée éditée",
    }
    request = get_csrf_request_with_db()
    request.context = full_sheet.entries[0]
    request.json_body = appstruct
    view = RestStatisticEntry(request)
    res = view.put()

    entry = full_sheet.entries[0]
    assert entry.title == u'Entrée éditée'
    assert entry.description == u"test entry"
Esempio n. 2
0
def test_rest_entry_edit(full_sheet, get_csrf_request_with_db):
    from autonomie.views.statistics import RestStatisticEntry
    appstruct = {
        "title": u"Entrée éditée",
    }
    request = get_csrf_request_with_db()
    request.context = full_sheet.entries[0]
    request.json_body = appstruct
    view = RestStatisticEntry(request)
    res = view.put()

    entry = full_sheet.entries[0]
    assert entry.title == u'Entrée éditée'
    assert entry.description == u"test entry"
def test_rest_entry_add(full_sheet, get_csrf_request_with_db):
    from autonomie.views.statistics import RestStatisticEntry
    appstruct = {
        "title": u"Nouvelle entrée",
        "description": u"Description",
    }
    request = get_csrf_request_with_db()
    request.context = full_sheet
    request.json_body = appstruct
    view = RestStatisticEntry(request)
    res = view.post()

    entry = full_sheet.entries[1]
    assert entry.title == u'Nouvelle entrée'
    assert entry.description == u"Description"
Esempio n. 4
0
def test_rest_entry_add(full_sheet, get_csrf_request_with_db):
    from autonomie.views.statistics import RestStatisticEntry
    appstruct = {
        "title": u"Nouvelle entrée",
        "description": u"Description",
    }
    request = get_csrf_request_with_db()
    request.context = full_sheet
    request.json_body = appstruct
    view = RestStatisticEntry(request)
    res = view.post()

    entry = full_sheet.entries[1]
    assert entry.title == u'Nouvelle entrée'
    assert entry.description == u"Description"