mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
improve test
This commit is contained in:
@@ -8,9 +8,7 @@ from tests.helpers import create_ctfd, destroy_ctfd
|
|||||||
def test_legal_settings():
|
def test_legal_settings():
|
||||||
app = create_ctfd()
|
app = create_ctfd()
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
set_config("tos_url", "https://ctfd.io/terms-of-use/")
|
|
||||||
set_config("tos_text", "Terms of Service")
|
set_config("tos_text", "Terms of Service")
|
||||||
set_config("privacy_url", "https://ctfd.io/privacy-policy/")
|
|
||||||
set_config("privacy_text", "Privacy Policy")
|
set_config("privacy_text", "Privacy Policy")
|
||||||
|
|
||||||
with app.test_client() as client:
|
with app.test_client() as client:
|
||||||
@@ -18,4 +16,12 @@ def test_legal_settings():
|
|||||||
assert r.status_code == 200
|
assert r.status_code == 200
|
||||||
assert "privacy policy" in r.get_data(as_text=True)
|
assert "privacy policy" in r.get_data(as_text=True)
|
||||||
assert "terms of service" in r.get_data(as_text=True)
|
assert "terms of service" in r.get_data(as_text=True)
|
||||||
|
|
||||||
|
r = client.get("/tos")
|
||||||
|
assert r.status_code == 200
|
||||||
|
assert "Terms of Service" in r.get_data(as_text=True)
|
||||||
|
|
||||||
|
r = client.get("/privacy")
|
||||||
|
assert r.status_code == 200
|
||||||
|
assert "Privacy Policy" in r.get_data(as_text=True)
|
||||||
destroy_ctfd(app)
|
destroy_ctfd(app)
|
||||||
|
|||||||
Reference in New Issue
Block a user