diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-04-04 16:48:02 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-04-04 16:48:02 -0700 |
commit | 9dfb5f3f83f715cdb16e68c4dedb12ca87bb93b3 (patch) | |
tree | b99ee6306e13f53d4eb3c6cdcbc71a0e028947a8 /python/tests/web_entity_views.py | |
parent | a7a9442144e3ab7dfafcfc2274016c58ac5558c0 (diff) | |
download | fatcat-9dfb5f3f83f715cdb16e68c4dedb12ca87bb93b3.tar.gz fatcat-9dfb5f3f83f715cdb16e68c4dedb12ca87bb93b3.zip |
many web test improvements
Diffstat (limited to 'python/tests/web_entity_views.py')
-rw-r--r-- | python/tests/web_entity_views.py | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/python/tests/web_entity_views.py b/python/tests/web_entity_views.py index fe2371ed..480b39cc 100644 --- a/python/tests/web_entity_views.py +++ b/python/tests/web_entity_views.py @@ -1,6 +1,5 @@ import json -import tempfile import pytest from fatcat_client.rest import ApiException from fixtures import * @@ -45,8 +44,11 @@ def test_entity_basics(app): rv = app.get('/{}/ccccccccccccccccccccccccca'.format(entity_type)) assert rv.status_code == 404 + # TODO: redirects and deleted entities -def test_container(app): + +def test_container(app_admin): + app = app_admin rv = app.get('/container/aaaaaaaaaaaaaeiraaaaaaaaai') assert rv.status_code == 200 @@ -55,7 +57,7 @@ def test_container(app): assert rv.status_code == 200 rv = app.get('/container/create') - # XXX: login assert rv.status_code == 200 + assert rv.status_code == 200 def test_lookups(app): @@ -103,35 +105,42 @@ def test_lookups(app): def test_web_creator(app): + # not logged in rv = app.get('/creator/aaaaaaaaaaaaaircaaaaaaaaai') assert rv.status_code == 200 - rv = app.get('/creator/aaaaaaaaaaaaaircaaaaaaaaai/edit') - assert rv.status_code == 200 + assert rv.status_code == 302 def test_web_file(app): + # not logged in rv = app.get('/file/aaaaaaaaaaaaamztaaaaaaaaai') assert rv.status_code == 200 - rv = app.get('/file/aaaaaaaaaaaaamztaaaaaaaaai/edit') - assert rv.status_code == 200 - + assert rv.status_code == 302 rv = app.get('/file/aaaaaaaaaaaaamztaaaaaaaaai/history') assert rv.status_code == 200 def test_web_release(app): + # not logged in rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaai') assert rv.status_code == 200 rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaai/edit') - assert rv.status_code == 200 - + assert rv.status_code == 302 rv = app.get('/release/create') - # XXX: login assert rv.status_code == 200 + assert rv.status_code == 302 + + +def test_web_release_login(app_admin): + + rv = app_admin.get('/release/aaaaaaaaaaaaarceaaaaaaaaai/edit') + assert rv.status_code == 200 + rv = app_admin.get('/release/create') + assert rv.status_code == 200 def test_web_search(app): |