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:
Disco DeDisco
2026-03-02 13:57:03 -05:00
parent 143e81fc41
commit e142e5d4d7
14 changed files with 624 additions and 3 deletions

View 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),
),
]

View File

@@ -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)

View File

@@ -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")