🤡(backend) demo template

Create the create_demo command.
It creates a demo template for the backend.
We add it in the makefile bootstrap.

We force the template id, this id is the same as
used in the frontend for the moment.
When the template feature will be created in
the frontend side we will not have to force
it anymore.
This commit is contained in:
Anthony LC
2024-04-10 16:29:28 +02:00
committed by Anthony LC
parent c6c0c1355d
commit a772d8fc29
4 changed files with 265 additions and 0 deletions

View File

View File

@@ -0,0 +1,22 @@
"""Test the `create_demo` management command"""
from unittest import mock
from django.core.management import call_command
from django.test import override_settings
import pytest
from core import models
pytestmark = pytest.mark.django_db
@override_settings(DEBUG=True)
def test_commands_create_demo():
"""The create_demo management command should create objects as expected."""
call_command("create_demo")
assert models.Template.objects.count() == 1