diff --git a/concordia/tests/test_views.py b/concordia/tests/test_views.py index 927f5384a..9e4bb5508 100644 --- a/concordia/tests/test_views.py +++ b/concordia/tests/test_views.py @@ -39,6 +39,7 @@ JSONAssertMixin, create_asset, create_campaign, + create_card_family, create_guide, create_item, create_project, @@ -376,6 +377,8 @@ def test_asset_detail_view(self): ) self.transcription.save() + asset.item.project.campaign.card_family = create_card_family() + asset.item.project.campaign.save() title = "Transcription: Basic Rules" create_guide(title=title) @@ -391,6 +394,7 @@ def test_asset_detail_view(self): ) ) self.assertEqual(response.status_code, 200) + self.assertIn("cards", response.context) self.assertIn("guides", response.context) self.assertEqual(title, response.context["guides"][0]["title"]) diff --git a/concordia/tests/utils.py b/concordia/tests/utils.py index e53b52aff..b38d2f6b8 100644 --- a/concordia/tests/utils.py +++ b/concordia/tests/utils.py @@ -8,6 +8,7 @@ Asset, Campaign, Card, + CardFamily, Guide, Item, MediaType, @@ -225,6 +226,13 @@ def create_card(*, title="Test Card", do_save=True, **kwargs): return card +def create_card_family(*, do_save=True, **kwargs): + card_family = CardFamily(**kwargs) + if do_save: + card_family.save() + return card_family + + def create_guide(*, do_save=True, **kwargs): guide = Guide(**kwargs) if do_save: