From 95317172ddee2ea6f18512262f481dd7f6fede8b Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 23 Apr 2018 20:36:57 -0700 Subject: basic api+route views for editor/changelog --- tests/api.py | 21 +++++++++++++++++++++ tests/routes.py | 6 ++++++ 2 files changed, 27 insertions(+) (limited to 'tests') diff --git a/tests/api.py b/tests/api.py index 8b495c61..5fff779e 100644 --- a/tests/api.py +++ b/tests/api.py @@ -287,3 +287,24 @@ def test_api_container_lookup(rich_app): data=json.dumps(dict(issn="not_even_valid_issn")), headers={"content-type": "application/json"}) assert rv.status_code == 400 + +def test_api_editor_get(rich_app): + app = rich_app + + rv = app.get('/v0/editor/admin', + headers={"content-type": "application/json"}) + assert rv.status_code == 200 + obj = json.loads(rv.data.decode('utf-8')) + print(obj) + assert obj['username'] == "admin" + assert obj['id'] == 1 + +def test_api_editor_changelog(rich_app): + app = rich_app + + rv = app.get('/v0/editor/admin/changelog', + headers={"content-type": "application/json"}) + assert rv.status_code == 200 + obj = json.loads(rv.data.decode('utf-8')) + print(obj) + assert len(obj) == 1 diff --git a/tests/routes.py b/tests/routes.py index 49afc5ce..e389a55f 100644 --- a/tests/routes.py +++ b/tests/routes.py @@ -32,3 +32,9 @@ def test_all_views(rich_app): rv = app.get('/editgroup/1') assert rv.status_code == 200 + + rv = app.get('/editor/admin') + assert rv.status_code == 200 + + rv = app.get('/editor/admin/changelog') + assert rv.status_code == 200 -- cgit v1.2.3