diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-23 20:36:57 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-23 20:36:57 -0700 |
commit | 95317172ddee2ea6f18512262f481dd7f6fede8b (patch) | |
tree | 29f80630f8b63dbade028049a7c38ee871ca50cb /tests | |
parent | 2688e18228e15558c99f1372f003ca95e7be4523 (diff) | |
download | fatcat-95317172ddee2ea6f18512262f481dd7f6fede8b.tar.gz fatcat-95317172ddee2ea6f18512262f481dd7f6fede8b.zip |
basic api+route views for editor/changelog
Diffstat (limited to 'tests')
-rw-r--r-- | tests/api.py | 21 | ||||
-rw-r--r-- | tests/routes.py | 6 |
2 files changed, 27 insertions, 0 deletions
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 |