Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Jul 15, 2024
1 parent cfbf91d commit ca78b8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions webapp/home/test/data/notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
"is_published": True,
},
"relations": {
"subsites": [
TEST_LABS[0],
TEST_LABS[1]
],
"subsites": [TEST_LABS[0]],
},
},
{
Expand Down
6 changes: 5 additions & 1 deletion webapp/home/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pathlib import Path

from .lab_export import ExportSubsiteContext
from .models import Notice
from .models import Notice, Subsite
from .test.data import (
TEST_NOTICES,
MOCK_REQUESTS,
Expand Down Expand Up @@ -46,7 +46,11 @@ def setUp(self) -> None:
super().setUp()
self.client = Client()
for notice in TEST_NOTICES:
subsites = notice['relations']['subsites']
notice = Notice.objects.create(**notice['data'])
for subsite in subsites:
subsite = Subsite.objects.get(name=subsite['name'])
notice.subsites.add(subsite)
for tag in TEST_TAGS:
Tag.objects.create(**tag)
for supporter in TEST_SUPPORTERS:
Expand Down

0 comments on commit ca78b8f

Please sign in to comment.