Skip to content

Commit

Permalink
CONCD-816 resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
rasarkar committed May 20, 2024
2 parents 3f11661 + 4e099de commit 5d8c39a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion concordia/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
create_asset,
create_campaign,
create_card_family,
create_guide,
create_item,
create_project,
create_topic,
Expand Down Expand Up @@ -378,6 +379,8 @@ def test_asset_detail_view(self):

asset.item.project.campaign.card_family = create_card_family()
asset.item.project.campaign.save()
title = "Transcription: Basic Rules"
create_guide(title=title)

response = self.client.get(
reverse(
Expand All @@ -390,9 +393,10 @@ 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"])

@patch.object(Asset, "get_ocr_transcript")
def test_generate_ocr_transcription(self, mock):
Expand Down
8 changes: 8 additions & 0 deletions concordia/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Campaign,
Card,
CardFamily,
Guide,
Item,
MediaType,
Project,
Expand Down Expand Up @@ -232,6 +233,13 @@ def create_card_family(*, do_save=True, **kwargs):
return card_family


def create_guide(*, do_save=True, **kwargs):
guide = Guide(**kwargs)
if do_save:
guide.save()
return guide


class JSONAssertMixin(object):
def assertValidJSON(self, response, expected_status=200):
"""
Expand Down

0 comments on commit 5d8c39a

Please sign in to comment.