Fourth companion renamed Tedi -> Omega (ω); slug stays tedi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
21
progress/migrations/0007_tedi_renamed_omega.py
Normal file
21
progress/migrations/0007_tedi_renamed_omega.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
همراهِ چهارم از «تدی» به «امگا» (ω) تغییرِ نام داد (خواستِ مالک، ۲۰۲۶-۱۰-۱۰): همهی همراهها
|
||||
نامِ یک حرفِ یونانیِ ریاضی دارند، و شکلِ گرد با دو گوشِ گردش شبیهِ ω است.
|
||||
|
||||
فقط نام عوض میشود و فقط اگر هنوز همان «تدی» باشد (ویرایشِ ادمین بازنویسی نمیشود). slug همان
|
||||
`tedi` میماند: شناسهی داخلی است و فرانت با آن شکلک را پیدا میکند؛ کاربر آن را نمیبیند.
|
||||
"""
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def rename(apps, schema_editor):
|
||||
apps.get_model('progress', 'Character').objects.filter(slug='tedi', name='تدی').update(name='امگا')
|
||||
|
||||
|
||||
def undo(apps, schema_editor):
|
||||
apps.get_model('progress', 'Character').objects.filter(slug='tedi', name='امگا').update(name='تدی')
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [('progress', '0006_drop_family_app')]
|
||||
operations = [migrations.RunPython(rename, undo)]
|
||||
@@ -258,7 +258,7 @@ class RebuildLeaderboardCommandTests(TestCase):
|
||||
|
||||
|
||||
class FourCompanionsCatalogTests(TestCase):
|
||||
"""migrationهای 0004 و 0005: سهیار و تدی همان چهار slugیاند که فرانت میشناسد."""
|
||||
"""migrationهای 0004، 0005 و 0007: سهیار و امگا (slugِ tedi) همان چهار slugیاند که فرانت میشناسد."""
|
||||
|
||||
def test_catalog_has_the_four_companions_in_order(self):
|
||||
rows = list(
|
||||
@@ -267,6 +267,9 @@ class FourCompanionsCatalogTests(TestCase):
|
||||
)
|
||||
self.assertEqual(rows, [('sigma', 0), ('delta', 100), ('pi', 300), ('tedi', 500)])
|
||||
|
||||
def test_the_fourth_companion_is_called_omega(self):
|
||||
self.assertEqual(Character.objects.get(slug='tedi').name, 'امگا')
|
||||
|
||||
|
||||
class LeaderboardPeriodValidationTests(TestCase):
|
||||
def setUp(self):
|
||||
|
||||
Reference in New Issue
Block a user