Skip to content

Commit

Permalink
Added unit test for bokejs_path() import
Browse files Browse the repository at this point in the history
  • Loading branch information
tbg committed Mar 21, 2024
1 parent 9b7d327 commit 7e04931
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit_tests/test_tethys_portal/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,12 @@ def test_bokeh_django_staticfiles_finder(self, _):
self.assertIn(
"bokeh_django.static.BokehExtensionFinder", settings.STATICFILES_FINDERS
)

@mock.patch("tethys_portal.optional_dependencies.optional_import")
def test_bokehjsdir_compatibility(self, mock_oi):
mock_bokeh_settings = mock.MagicMock()
mock_oi.return_value = mock_bokeh_settings
mock_bokeh_settings.bokehjs_path.side_effect = AttributeError()
reload(settings)
mock_bokeh_settings.bokehjs_path.assert_called_once()
mock_bokeh_settings.bokehjsdir.assert_called_once()

0 comments on commit 7e04931

Please sign in to comment.