Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions dashboard/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import sys
import types

import pytest

from django.contrib.auth.models import Permission, User
from django.http import HttpResponse


@pytest.fixture
Expand Down Expand Up @@ -85,27 +81,3 @@ def user_is_staff(client):
)
client.login(username="staffmember", password="password")
return user


# 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
Loading