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 fd19dde commit cfbf91d
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions webapp/home/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
from pathlib import Path

from .lab_export import ExportSubsiteContext
from .models import Notice, Subsite
from .models import Notice
from .test.data import (
TEST_NOTICES,
TEST_LABS,
MOCK_REQUESTS,
MOCK_LAB_BASE_URL,
)
Expand Down Expand Up @@ -46,16 +45,8 @@ def setUp(self) -> None:
"""Create some data to request a landing page."""
super().setUp()
self.client = Client()

for subsite in TEST_LABS[1:]:
# First TEST_LAB "main" is created on DB migration
Subsite.objects.create(**subsite)
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 Expand Up @@ -164,20 +155,6 @@ def test_home_landing_webpage(self):
TEST_EVENTS[1]['data']['title'],
)

def test_subsite_landing_webpage(self):
response = self.client.get(f'/landing/{TEST_LABS[1]["name"]}')
self.assertEqual(response.status_code, 200)

# Appropriate notices are being shown
self.assertContains(
response,
TEST_NOTICES[1]['data']['title'],
)
self.assertNotContains(
response,
TEST_NOTICES[0]['data']['title'],
)

def test_aaf_webpage(self):
try:
response = self.client.get('/aaf')
Expand Down

0 comments on commit cfbf91d

Please sign in to comment.