sciagent code + Gitea Actions CI/CD
CI/CD / backend (push) Failing after 2m8s
CI/CD / frontend (push) Failing after 1m40s
CI/CD / deploy (push) Has been skipped

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Thinh Lam
2026-06-30 09:38:30 +07:00
commit 688fac73e9
1167 changed files with 158244 additions and 0 deletions
@@ -0,0 +1,66 @@
"""Unit tests for merit label derivation from draft JSON (notification body).
Run: cd be0 && python -m unittest tests.test_user_notifications_merit -v
"""
from __future__ import annotations
import unittest
class MeritCategoryFromDraftTests(unittest.TestCase):
def test_poster_without_review_is_trung_binh(self) -> None:
from src.initiative_db.user_notifications import merit_category_label_from_draft_payload
payload = {
"tabs": {
"application": {
"initiativeClassification": "research",
"researchEvidenceKind": "poster-without-review",
}
}
}
self.assertEqual(merit_category_label_from_draft_payload(payload), "Trung bình")
def test_international_remains_xuat_sac(self) -> None:
from src.initiative_db.user_notifications import merit_category_label_from_draft_payload
payload = {
"tabs": {
"application": {
"initiativeClassification": "research",
"researchEvidenceKind": "international",
}
}
}
self.assertEqual(merit_category_label_from_draft_payload(payload), "Xuất sắc")
def test_textbook_book_is_xuat_sac(self) -> None:
from src.initiative_db.user_notifications import merit_category_label_from_draft_payload
payload = {
"tabs": {
"application": {
"initiativeClassification": "textbook",
"textbookEvidenceKind": "book",
}
}
}
self.assertEqual(merit_category_label_from_draft_payload(payload), "Xuất sắc")
def test_poster_with_review_still_kha_bucket(self) -> None:
from src.initiative_db.user_notifications import merit_category_label_from_draft_payload
payload = {
"tabs": {
"application": {
"initiativeClassification": "research",
"researchEvidenceKind": "poster",
}
}
}
self.assertEqual(merit_category_label_from_draft_payload(payload), "Khá")
if __name__ == "__main__":
unittest.main()