🤡(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:
0
src/backend/demo/tests/__init__.py
Normal file
0
src/backend/demo/tests/__init__.py
Normal file
22
src/backend/demo/tests/test_commands_create_demo.py
Normal file
22
src/backend/demo/tests/test_commands_create_demo.py
Normal 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
|
||||
Reference in New Issue
Block a user