def test_create(email, presentation): pres = storage.store_presentation(email, presentation) assert pres['email'] == email assert pres['id'] assert storage.get_meta(pres['id'], 'title') == pres['title'] assert storage.get_meta(pres['id'], 'email') == pres['email'] assert json.loads(storage.get_json(pres['id'])) == pres
def handle_presentation(presentation_id): if (not request.accept_mimetypes.accept_html and not request.accept_mimetypes.accept_json): abort(406) if request.method in ['POST', 'PUT']: storage.store_slides(presentation_id, session['email'], request.json) data = storage.get_json(presentation_id) if request.accept_mimetypes.accept_html: return render_template('presentation.html', pres=json.loads(data)) elif request.accept_mimetypes.accept_json: return json_response(data, encode=False)