Fix types

This commit is contained in:
Joakim Hellsén 2026-03-16 18:40:04 +01:00
commit c092d3089f
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
13 changed files with 48 additions and 18 deletions

View file

@ -279,6 +279,7 @@ class RSSFeedTestCase(TestCase):
def test_campaign_and_game_feeds_use_absolute_media_enclosure_urls(self) -> None:
"""Campaign/game RSS+Atom enclosures should use absolute URLs for local media files."""
self.game.box_art = ""
assert self.game.box_art_file is not None
self.game.box_art_file.save(
"box.png",
ContentFile(b"game-image-bytes"),
@ -289,6 +290,7 @@ class RSSFeedTestCase(TestCase):
self.game.save()
self.campaign.image_url = ""
assert self.campaign.image_file is not None
self.campaign.image_file.save(
"campaign.png",
ContentFile(b"campaign-image-bytes"),
@ -712,6 +714,7 @@ class RSSFeedTestCase(TestCase):
name="File Game",
display_name="File Game",
)
assert game2.box_art_file is not None
game2.box_art_file.save("sample.png", ContentFile(b"hello"))
game2.save()
@ -723,6 +726,7 @@ class RSSFeedTestCase(TestCase):
end_at=timezone.now() + timedelta(days=1),
operation_names=["DropCampaignDetails"],
)
assert campaign2.image_file is not None
campaign2.image_file.save("camp.jpg", ContentFile(b"world"))
campaign2.save()

View file

@ -1067,9 +1067,18 @@ class TestSEOHelperFunctions:
def test_build_seo_context_with_all_parameters(self) -> None:
"""Test _build_seo_context with all parameters."""
now: datetime.datetime = timezone.now()
breadcrumb: list[dict[str, int | str]] = [
{"position": 1, "name": "Home", "url": "/"},
]
breadcrumb: dict[str, Any] = {
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "/",
},
],
}
context: dict[str, Any] = _build_seo_context(
page_title="Test",
@ -1077,7 +1086,7 @@ class TestSEOHelperFunctions:
page_image="https://example.com/img.jpg",
og_type="article",
schema_data={},
breadcrumb_schema=breadcrumb, # pyright: ignore[reportArgumentType]
breadcrumb_schema=breadcrumb,
pagination_info=[{"rel": "next", "url": "/page/2/"}],
published_date=now.isoformat(),
modified_date=now.isoformat(),