Skip to content

Commit

Permalink
test: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zawan-ila committed Feb 25, 2025
1 parent b191d42 commit 641a2a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion course_discovery/apps/core/tests/test_api_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def test_get_course_run_translations_and_transcriptions(self):
)

result = self.lms.get_course_run_translations_and_transcriptions(course_run_id)
assert result == translation_data
assert result == response_data

@responses.activate
def test_get_course_run_translations_and_transcriptions_with_error(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ class UpdateCourseAiLanguagesTests(TestCase):
AI_LANGUAGES_DATA = {
'available_translation_languages': [
{'code': 'fr', 'label': 'French'},
{'code': 'es', 'label': 'Spanish'}
{'code': 'cs', 'label': 'Czech'}
],
'feature_enabled': True,
}

AI_LANGUAGES_DATA_WITH_TRANSCRIPTIONS = {
**AI_LANGUAGES_DATA,
'transcription_languages': ['en', 'fr']
'transcription_languages': ['da', 'fr']
}

def setUp(self):
Expand All @@ -42,7 +42,7 @@ def assert_ai_langs(self, run, data):
)
self.assertListEqual(
run.ai_languages['transcription_languages'],
data.get('transcription_languages', [])
[{'code': lang_code, 'label': lang_code} for lang_code in data.get('transcription_languages', [])]
)


Expand Down Expand Up @@ -157,6 +157,8 @@ def test_command_with_marketable_and_active_flag(self, mock_data, mock_get_trans
call_command('update_course_ai_languages', partner=self.partner.name, marketable=True, active=True)

marketable_non_active_course_run.refresh_from_db()
active_non_marketable_course_run.refresh_from_db()
non_active_non_marketable_course_run.refresh_from_db()
self.assert_ai_langs(marketable_non_active_course_run, mock_data)
self.assert_ai_langs(active_non_marketable_course_run, mock_data)
assert non_active_non_marketable_course_run.ai_languages is None
Expand Down

0 comments on commit 641a2a3

Please sign in to comment.