Merge pull request #746 from mig5/fix_public_mode_test

Fix public mode tests for 404
This commit is contained in:
Micah Lee 2018-09-15 21:50:59 -07:00 committed by GitHub
commit 7a90378f80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,14 +173,15 @@ class TestWeb:
common_obj.settings.set('public_mode', True)
with web.app.test_client() as c:
# Upload page should be accessible from both / and /[slug]
# Upload page should be accessible from /
res = c.get('/')
data1 = res.get_data()
assert res.status_code == 200
# /[slug] should be a 404
res = c.get('/{}'.format(web.slug))
data2 = res.get_data()
assert res.status_code == 200
assert res.status_code == 404
def test_public_mode_off(self, common_obj):
web = web_obj(common_obj, True)
@ -192,7 +193,7 @@ class TestWeb:
data1 = res.get_data()
assert res.status_code == 404
# Upload page should be accessible from both /[slug]
# Upload page should be accessible from /[slug]
res = c.get('/{}'.format(web.slug))
data2 = res.get_data()
assert res.status_code == 200