|
|
@ -1,4 +1,4 @@
|
|
|
|
from . util import live_server_setup, extract_UUID_from_client
|
|
|
|
from .util import live_server_setup, extract_UUID_from_client, wait_for_all_checks
|
|
|
|
from flask import url_for
|
|
|
|
from flask import url_for
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
|
|
|
|
|
|
|
@ -19,10 +19,16 @@ def test_check_access_control(app, client, live_server):
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
assert b"1 Imported" in res.data
|
|
|
|
assert b"1 Imported" in res.data
|
|
|
|
time.sleep(2)
|
|
|
|
time.sleep(3)
|
|
|
|
res = client.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
# causes a 'Popped wrong request context.' error when client. is accessed?
|
|
|
|
|
|
|
|
#wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res = c.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
assert b'1 watches queued for rechecking.' in res.data
|
|
|
|
assert b'1 watches queued for rechecking.' in res.data
|
|
|
|
time.sleep(2)
|
|
|
|
time.sleep(3)
|
|
|
|
|
|
|
|
# causes a 'Popped wrong request context.' error when client. is accessed?
|
|
|
|
|
|
|
|
#wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Enable password check and diff page access bypass
|
|
|
|
# Enable password check and diff page access bypass
|
|
|
|
res = c.post(
|
|
|
|
res = c.post(
|
|
|
@ -42,7 +48,7 @@ def test_check_access_control(app, client, live_server):
|
|
|
|
assert b"Login" in res.data
|
|
|
|
assert b"Login" in res.data
|
|
|
|
|
|
|
|
|
|
|
|
# The diff page should return something valid when logged out
|
|
|
|
# The diff page should return something valid when logged out
|
|
|
|
res = client.get(url_for("diff_history_page", uuid="first"))
|
|
|
|
res = c.get(url_for("diff_history_page", uuid="first"))
|
|
|
|
assert b'Random content' in res.data
|
|
|
|
assert b'Random content' in res.data
|
|
|
|
|
|
|
|
|
|
|
|
# Check wrong password does not let us in
|
|
|
|
# Check wrong password does not let us in
|
|
|
@ -83,6 +89,8 @@ def test_check_access_control(app, client, live_server):
|
|
|
|
res = c.get(url_for("logout"),
|
|
|
|
res = c.get(url_for("logout"),
|
|
|
|
follow_redirects=True)
|
|
|
|
follow_redirects=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert b"Login" in res.data
|
|
|
|
|
|
|
|
|
|
|
|
res = c.get(url_for("settings_page"),
|
|
|
|
res = c.get(url_for("settings_page"),
|
|
|
|
follow_redirects=True)
|
|
|
|
follow_redirects=True)
|
|
|
|
|
|
|
|
|
|
|
@ -160,5 +168,5 @@ def test_check_access_control(app, client, live_server):
|
|
|
|
assert b"Login" in res.data
|
|
|
|
assert b"Login" in res.data
|
|
|
|
|
|
|
|
|
|
|
|
# The diff page should return something valid when logged out
|
|
|
|
# The diff page should return something valid when logged out
|
|
|
|
res = client.get(url_for("diff_history_page", uuid="first"))
|
|
|
|
res = c.get(url_for("diff_history_page", uuid="first"))
|
|
|
|
assert b'Random content' not in res.data
|
|
|
|
assert b'Random content' not in res.data
|
|
|
|