Tutor/answers: bare subscripts (S_n, a_1) become Unicode; migration 0022 re-cleans DB text

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 12:18:46 +03:30
parent e662914efc
commit b075b93f2a
5 changed files with 31 additions and 4 deletions

View File

@@ -23,3 +23,11 @@ class HistoryNeverShowsLatexTests(TestCase):
self.assertNotIn('^', t)
self.assertNotIn('$', t)
self.assertIn('x²', texts[0])
class ToPlainSubscriptTests(TestCase):
def test_bare_subscripts_are_unicode(self):
from rag.services.mathtext import to_plain
out = to_plain('S_n = n/2 × (a_1 + a_n)')
self.assertNotIn('_', out)
self.assertIn('Sₙ', out)