Skip to content

Commit

Permalink
fix: fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan committed Feb 4, 2025
1 parent d23a0a6 commit e8e3cdf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lms/djangoapps/courseware/tests/test_word_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ def test_word_cloud_constructor(self, mock_render_django_template):
uuid_str = re.search(r"UUID\('([a-f0-9\-]+)'\)", fragment.content).group(1)
expected_context['element_id'] = UUID(uuid_str)
mock_render_django_template.assert_called_once()
assert fragment.content == self.runtime.render_template('templates/word_cloud.html', expected_context)
# Remove i18n service
fragment_content_clean = re.sub(r"\{.*?\}", "{}", fragment.content)
assert fragment_content_clean == self.runtime.render_template('templates/word_cloud.html', expected_context)
else:
expected_context['ajax_url'] = self.block.ajax_url
expected_context['element_id'] = self.block.location.html_id()
Expand Down

0 comments on commit e8e3cdf

Please sign in to comment.