feat: require standalone admin login before the web workbench
This commit is contained in:
@@ -513,12 +513,18 @@ class ApiTests(unittest.TestCase):
|
||||
for url in ("/static/.env", "/static/config.py", "/static/../app.py", "/static/%2e%2e/requirements.txt"):
|
||||
with self.subTest(url=url):
|
||||
self.assertEqual(self.client.get(url).status_code, 404)
|
||||
response = self.client.get("/")
|
||||
self.assertIn(response.status_code, (200, 503))
|
||||
if response.status_code == 200:
|
||||
for url in ("/", "/static/index.html", "/static/app.js"):
|
||||
response = self.client.get(url)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.headers["cache-control"], "no-store")
|
||||
self.assertEqual(response.headers["x-content-type-options"], "nosniff")
|
||||
self.assertIn("frame-ancestors 'none'", response.headers["content-security-policy"])
|
||||
for url in ("/", "/static/index.html"):
|
||||
response = self.client.get(url)
|
||||
self.assertIn("text/html", response.headers["content-type"])
|
||||
self.assertEqual(response.headers["x-content-type-options"], "nosniff")
|
||||
self.assertIn("frame-ancestors 'none'", response.headers["content-security-policy"])
|
||||
response = self.client.get("/login", follow_redirects=False)
|
||||
self.assertEqual(response.status_code, 303)
|
||||
self.assertEqual(response.headers["location"], "/")
|
||||
|
||||
def test_cli_help_and_factory_do_not_import_qt_or_open_private_state(self):
|
||||
project = Path(__file__).resolve().parents[2]
|
||||
|
||||
Reference in New Issue
Block a user