feat: improve coverage

This commit is contained in:
2025-01-23 17:32:16 +01:00
parent 0cef264b40
commit 90bcfe298b
4 changed files with 66 additions and 57 deletions
@@ -26,9 +26,7 @@ class Command(BaseCommand):
def handle(self, *args, **options):
web_settings = WebSettings.load()
path = os.path.join(
settings.BASE_DIR, "theme", "static", "css", "main.css"
)
path = os.path.join(settings.BASE_DIR, "theme", "static", "css", "main.css")
colors = []
for color_name, data in web_settings.theme_colors.items():
@@ -38,18 +36,21 @@ class Command(BaseCommand):
result = str(
render_to_string(
"theme/main.css.template", context={"colors": colors},
"theme/main.css.template",
context={"colors": colors},
)
)
with open(path, "w") as f:
f.write(result)
subprocess.run([
"tailwindcss",
"-i",
"theme/static/css/main.css",
"-o",
"theme/static/css/styles.css",
"--minify",
])
subprocess.run(
[
"tailwindcss",
"-i",
"theme/static/css/main.css",
"-o",
"theme/static/css/styles.css",
"--minify",
]
)
call_command("collectstatic", "--no-input")