diff --git a/dashboard/conftest.py b/dashboard/conftest.py new file mode 100644 index 0000000..67d462a --- /dev/null +++ b/dashboard/conftest.py @@ -0,0 +1,28 @@ +import sys +import types + +from django.http import HttpResponse + + +# Creat a "fake" mozilla_django_oidc.views so that tests will run, +# even if mozilla_django_oidc is not available at import time for +# tests. + +if "mozilla_django_oidc" not in sys.modules: + oidc_module = types.ModuleType("mozilla_django_oidc") + oidc_views_module = types.ModuleType("mozilla_django_oidc.views") + + class _DummyOIDCView: + @classmethod + def as_view(cls): + def _view(request, *args, **kwargs): + return HttpResponse("") + + return _view + + oidc_views_module.OIDCAuthenticationRequestView = _DummyOIDCView + oidc_views_module.OIDCAuthenticationCallbackView = _DummyOIDCView + oidc_views_module.OIDCLogoutView = _DummyOIDCView + oidc_module.views = oidc_views_module + sys.modules["mozilla_django_oidc"] = oidc_module + sys.modules["mozilla_django_oidc.views"] = oidc_views_module \ No newline at end of file diff --git a/dashboard/requirements.txt b/dashboard/requirements.txt index ebc23e5..1ccb8b6 100644 --- a/dashboard/requirements.txt +++ b/dashboard/requirements.txt @@ -2,7 +2,7 @@ Django==5.2.13 PyYAML==6.0.2 docutils==0.21.2 whitenoise==6.9.0 -psycopg2-binary==2.9.10 +psycopg2-binary==2.9.11 tzdata==2025.1 django-browser-reload==1.18.0 django-tinymce==4.1.0