test_middleware_utils.py 588 B

12345678910111213141516171819202122
  1. import sys
  2. from unittest import TestCase
  3. from django_sso_tests import mock_django_auth_views
  4. from django_sso.middleware.utils import get_auth_views
  5. sys.modules["django.contrib.auth.views"] = mock_django_auth_views
  6. class MiddlewareAppsInstalledTests(TestCase):
  7. def test_get_auth_views_login(self):
  8. view_func = mock_django_auth_views.LoginView.as_view
  9. _ = view_func()
  10. def test_get_auth_views_logout(self):
  11. view_func = mock_django_auth_views.LogoutView.as_view
  12. _ = view_func()
  13. def test_get_auth_views(self):
  14. _, _ = get_auth_views()