feat: update prediction workbook output

This commit is contained in:
2026-07-06 18:33:52 +08:00
parent c7ee2adb82
commit 0a12eb7f3b
8 changed files with 219 additions and 78 deletions
+13
View File
@@ -130,6 +130,19 @@ class RegistrationRoutesTest(unittest.TestCase):
self.assertIn('name="captcha"', html)
self.assertIn(captcha, html)
def test_template_download_uses_chinese_filename(self) -> None:
with TemporaryDirectory() as temp_dir:
app = self.create_test_app(temp_dir, allow_registration=True)
response = app.test_client().get("/download_template")
self.assertEqual(response.status_code, 200)
self.assertIn("attachment", response.headers["Content-Disposition"])
self.assertIn(
"filename*=UTF-8''%E7%AE%A1%E9%81%93%E9%A2%84%E6%B5%8B%E6%95%B0%E6%8D%AE%E6%A8%A1%E6%9D%BF.xlsx",
response.headers["Content-Disposition"],
)
def test_register_post_does_not_create_user_when_registration_is_closed(self) -> None:
with TemporaryDirectory() as temp_dir:
app = self.create_test_app(temp_dir, allow_registration=False)