new FT test_theme for theme switcher functionality; theme-switcher content added to home.html, several dashboard views & urls, all appropriate ITs & UTs; lyric user model saves theme (migrations run); django-compressor and django-libsass libraries added to dependencies
This commit is contained in:
18
src/apps/lyric/migrations/0003_user_theme.py
Normal file
18
src/apps/lyric/migrations/0003_user_theme.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 6.0 on 2026-03-02 04:15
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('lyric', '0002_user_searchable_user_username'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='user',
|
||||
name='theme',
|
||||
field=models.CharField(default='theme-default', max_length=32),
|
||||
),
|
||||
]
|
||||
@@ -26,6 +26,8 @@ class User(AbstractBaseUser):
|
||||
email = models.EmailField(unique=True)
|
||||
username = models.CharField(max_length=35, unique=True, null=True, blank=True)
|
||||
searchable = models.BooleanField(default=False)
|
||||
theme = models.CharField(max_length=32, default="theme-default")
|
||||
|
||||
is_staff = models.BooleanField(default=False)
|
||||
is_superuser = models.BooleanField(default=False)
|
||||
|
||||
|
||||
@@ -50,3 +50,8 @@ class UserManagerTest(TestCase):
|
||||
password="correct-password",
|
||||
)
|
||||
self.assertTrue(user.check_password("correct-password"))
|
||||
|
||||
class UserThemeTest(TestCase):
|
||||
def test_theme_field_defaults_to_theme_default(self):
|
||||
user = User.objects.create(email="a@b.cde")
|
||||
self.assertEqual(user.theme, "theme-default")
|
||||
|
||||
Reference in New Issue
Block a user