summaryrefslogtreecommitdiffstats
path: root/python/tests/web_editgroup.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-04-04 16:48:02 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-04-04 16:48:02 -0700
commit9dfb5f3f83f715cdb16e68c4dedb12ca87bb93b3 (patch)
treeb99ee6306e13f53d4eb3c6cdcbc71a0e028947a8 /python/tests/web_editgroup.py
parenta7a9442144e3ab7dfafcfc2274016c58ac5558c0 (diff)
downloadfatcat-9dfb5f3f83f715cdb16e68c4dedb12ca87bb93b3.tar.gz
fatcat-9dfb5f3f83f715cdb16e68c4dedb12ca87bb93b3.zip
many web test improvements
Diffstat (limited to 'python/tests/web_editgroup.py')
-rw-r--r--python/tests/web_editgroup.py50
1 files changed, 46 insertions, 4 deletions
diff --git a/python/tests/web_editgroup.py b/python/tests/web_editgroup.py
index e6185eda..2ce90fcb 100644
--- a/python/tests/web_editgroup.py
+++ b/python/tests/web_editgroup.py
@@ -1,20 +1,62 @@
import json
-import tempfile
import pytest
from fatcat_client.rest import ApiException
from fixtures import *
-def test_web_editgroup(app):
+def test_editgroup_basics(app):
rv = app.get('/editgroup/aaaaaaaaaaaabo53aaaaaaaaae')
assert rv.status_code == 200
-
rv = app.get('/editgroup/ccccccccccccccccccccccccca')
assert rv.status_code == 404
rv = app.get('/editor/aaaaaaaaaaaabkvkaaaaaaaaae')
assert rv.status_code == 200
-
+ rv = app.get('/editor/ccccccccccccccccccccccccca')
+ assert rv.status_code == 404
rv = app.get('/editor/aaaaaaaaaaaabkvkaaaaaaaaae/editgroups')
assert rv.status_code == 200
+ rv = app.get('/editor/ccccccccccccccccccccccccca/editgroups')
+ assert rv.status_code == 404
+
+ rv = app.get('/changelog')
+ assert rv.status_code == 200
+ rv = app.get('/changelog/1')
+ assert rv.status_code == 200
+ rv = app.get('/changelog/1.3')
+ assert rv.status_code == 404
+ rv = app.get('/changelog/9999999')
+ assert rv.status_code == 404
+
+ rv = app.get('/reviewable')
+ assert rv.status_code == 200
+
+def test_editgroup_annotations(app):
+
+ rv = app.get('/editgroup/aaaaaaaaaaaabo53aaaaaaaaa4')
+ assert rv.status_code == 200
+ assert b'updated with changes, please re-review' in rv.data
+ assert b'concerns about this edit...' in rv.data
+ assert b'Admin' in rv.data
+ assert b'demo-user' in rv.data
+ assert b'claire' in rv.data
+ assert b'Signup' in rv.data
+ assert b'Add Comment' not in rv.data
+
+ rv = app.get('/editor/aaaaaaaaaaaabkvkaaaaaaaaaq/annotations')
+ assert rv.status_code == 200
+ assert b'updated with changes, please re-review' not in rv.data
+ assert b'concerns about this edit...' in rv.data
+ assert b'Admin' not in rv.data
+ assert b'claire' in rv.data
+ assert b'aaaaaaaaaaaabo53aaaaaaaaa4' in rv.data
+
+def test_editgroup_annotations_login(app_admin):
+
+ # if logged in, should see form
+ rv = app_admin.get('/editgroup/aaaaaaaaaaaabo53aaaaaaaaa4')
+ assert rv.status_code == 200
+ assert b'Signup' not in rv.data
+ assert b'Add Comment' in rv.data
+