Skip to content

Commit c24ca5a

Browse files
author
Roxanna Coldiron
committed
WIP tests
1 parent 9a60252 commit c24ca5a

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

coderedcms/models/tests/test_navbars_and_footers.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# what imports do I need?
2+
# possibly use https://pypi.org/project/django-test-migrations/ instead?
23

4+
import json
35
from django.apps import apps
46
from django.test import Client, TestCase
7+
# from django_test_migrations.contrib.unittest_case import MigratorTestCase
58
from django.db.migrations.executor import MigrationExecutor
69
from django.db import connection
710

@@ -13,8 +16,8 @@
1316
FooterOrderable
1417
)
1518

16-
# Set up
1719

20+
# Set up
1821
class TestMigrations(TestCase):
1922

2023
@property
@@ -24,18 +27,23 @@ def app(self):
2427
migrate_from = None
2528
migrate_to = None
2629

30+
2731
# Need to create Site that has navbar and footer the current way
2832
class NavsandFootersTestCase(TestMigrations):
2933

30-
def setUpBeforeMigration(self, apps):
34+
def prepare(self, apps):
3135
NavbarInitial = Navbar.objects.create(
3236
name = "Main Nav",
33-
menu_items = # how to add streamfield items here??,
37+
menu_items = json.dumps[
38+
{\"type\": \"row\", \"value\": {\"settings\": {\"custom_template\": \"\", \"custom_css_class\": \"\", \"custom_id\": \"\"}, \"fluid\": false, \"content\": [{\"type\": \"content\", \"value\": {\"settings\": {\"custom_template\": \"\", \"custom_css_class\": \"\", \"custom_id\": \"\", \"column_breakpoint\": \"md\"}, \"column_size\": \"\", \"content\": [{\"type\": \"text\", \"value\": \"<h2>Footer Content</h2>\", \"id\": \"5d6be173-bab8-4d2f-93a9-94614267e776\"}]}, \"id\": \"016bdac5-0b6c-484f-ae53-b9ae115d5dd9\"}]}, \"id\": \"0d39786b-e959-4382-898a-20946f979da1\"}
39+
]
3440

3541
)
3642
FooterInitial = Footer.objects.create(
3743
name = "Main Footer",
38-
content = # how to add streamfield items here??,
44+
content = json.dumps[
45+
{\"type\": \"row\", \"value\": {\"settings\": {\"custom_template\": \"\", \"custom_css_class\": \"\", \"custom_id\": \"\"}, \"fluid\": false, \"content\": [{\"type\": \"content\", \"value\": {\"settings\": {\"custom_template\": \"\", \"custom_css_class\": \"\", \"custom_id\": \"\", \"column_breakpoint\": \"md\"}, \"column_size\": \"\", \"content\": [{\"type\": \"text\", \"value\": \"<h2>Footer Content</h2>\", \"id\": \"5d6be173-bab8-4d2f-93a9-94614267e776\"}]}, \"id\": \"016bdac5-0b6c-484f-ae53-b9ae115d5dd9\"}]}, \"id\": \"0d39786b-e959-4382-898a-20946f979da1\"}
46+
]
3947
)
4048

4149

0 commit comments

Comments
 (0)