mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Add test for legal pages
This commit is contained in:
21
tests/test_legal.py
Normal file
21
tests/test_legal.py
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from CTFd.utils import set_config
|
||||
from tests.helpers import create_ctfd, destroy_ctfd
|
||||
|
||||
|
||||
def test_legal_settings():
|
||||
app = create_ctfd()
|
||||
with app.app_context():
|
||||
set_config("tos_url", "https://ctfd.io/terms-of-use/")
|
||||
set_config("tos_text", "Terms of Service")
|
||||
set_config("privacy_url", "https://ctfd.io/privacy-policy/")
|
||||
set_config("privacy_text", "Privacy Policy")
|
||||
|
||||
with app.test_client() as client:
|
||||
r = client.get("/register")
|
||||
assert r.status_code == 200
|
||||
assert "privacy policy" in r.get_data(as_text=True)
|
||||
assert "terms of service" in r.get_data(as_text=True)
|
||||
destroy_ctfd(app)
|
||||
Reference in New Issue
Block a user