aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/web_editgroup.py
diff options
context:
space:
mode:
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
+