Lesson.order from the book (seed sets it, also re-syncs unit/node order); matrix lesson rows as one multi-line step

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 13:53:30 +03:30
parent 3f68abe741
commit 8a2bf26b16
6 changed files with 65 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ class StableOrderTests(TestCase):
def test_content_querysets_have_explicit_order(self):
for qs in (Lesson.objects.all(), Question.objects.all(), Choice.objects.all()):
self.assertIn('ORDER BY', str(qs.query), qs.model.__name__)
self.assertEqual(qs.query.order_by or qs.model._meta.ordering, ['id'])
self.assertEqual(qs.model._meta.ordering[-1], 'id')
def test_lessons_come_back_in_creation_order_after_updates(self):
grade = Grade.objects.create(title='پایه', number=99)