Skip to content

Commit

Permalink
Add test for one language slide generation
Browse files Browse the repository at this point in the history
  • Loading branch information
JackMorganNZ committed Aug 23, 2022
1 parent d0f1f17 commit d2c4c35
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,34 @@ def test_slides_file_generation_view_multiple_lessons_multiple_languages(self):
},
}
)

@override_settings(DEFAULT_LANGUAGES=MULTIPLE_LANGUAGES)
def test_slides_file_generation_view_multiple_lessons_multiple_languages_one_requested(self):
lesson1 = self.test_data.create_lesson(1)
lesson1.languages = [LANGUAGE1, LANGUAGE2]
lesson1.save()
lesson2 = self.test_data.create_lesson(2)
lesson2.languages = [LANGUAGE1]
lesson2.save()
lesson3 = self.test_data.create_lesson(3)
lesson3.languages = [LANGUAGE2]
lesson3.save()
url = reverse("at_a_distance:slides_file_generation_json") + "?language=lang2"
response = self.client.get(url)
self.assertJSONEqual(
response.content.decode(),
{
"resolution": "1920x1080",
"slide_counts": {
"lesson-1": 2,
"lesson-2": 4,
"lesson-3": 7,
},
"languages": {
LANGUAGE2: [
"lesson-1",
"lesson-3",
]
},
}
)

0 comments on commit d2c4c35

Please sign in to comment.