From 347f0ed6c7691c0a1fee1ddc8099ff063f58515c Mon Sep 17 00:00:00 2001 From: Trevor Cox <2498876+trevoriancox@users.noreply.github.com> Date: Wed, 5 Aug 2020 09:48:00 -0700 Subject: [PATCH] To allow tests to be run in context with a custom user model, call get_user_model in tests. (#90) Co-authored-by: Trevor Cox --- shibboleth/tests/test_shib.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shibboleth/tests/test_shib.py b/shibboleth/tests/test_shib.py index fd645b5..9de8163 100755 --- a/shibboleth/tests/test_shib.py +++ b/shibboleth/tests/test_shib.py @@ -5,12 +5,14 @@ from django.contrib import auth from django.contrib.auth.middleware import AuthenticationMiddleware from django.contrib.auth.middleware import RemoteUserMiddleware -from django.contrib.auth.models import User, Group +from django.contrib.auth.models import Group +from django.contrib.auth import get_user_model from django.contrib.sessions.middleware import SessionMiddleware from django.db.utils import IntegrityError from django.test import TestCase, RequestFactory from django import VERSION +User = get_user_model() SAMPLE_HEADERS = { "REMOTE_USER": 'sampledeveloper@school.edu',