PLAT-1858 Better capture of deprecation warnings

This commit is contained in:
Jeremy Bowman
2017-12-14 14:30:40 -05:00
parent 6388391da6
commit b26fe5fd24
12 changed files with 58 additions and 30 deletions

View File

@@ -2412,7 +2412,9 @@ def auto_auth(request):
# Log in as the user
if login_when_done:
user = authenticate(username=username, password=password)
backend = load_backend(NEW_USER_AUTH_BACKEND)
user = backend.authenticate(request=request, username=username, password=password)
user.backend = NEW_USER_AUTH_BACKEND
login(request, user)
create_comments_service_user(user)

View File

@@ -1,6 +1,11 @@
[pytest]
DJANGO_SETTINGS_MODULE = openedx.tests.settings
addopts = --nomigrations --reuse-db --durations=20
# Enable default handling for all warnings, including those that are ignored by default;
# but hide rate-limit warnings, because we deliberately don't throttle test user logins
filterwarnings =
default
ignore:No request passed to the backend, unable to rate-limit.*:UserWarning
norecursedirs = .cache
python_classes =
python_files = tests.py test_*.py tests_*.py *_tests.py __init__.py

View File

@@ -1,3 +1,8 @@
[pytest]
addopts = -p no:randomly --durations=20
# Enable default handling for all warnings, including those that are ignored by default;
# but hide rate-limit warnings, because we deliberately don't throttle test user logins
filterwarnings =
default
ignore:No request passed to the backend, unable to rate-limit.*:UserWarning
norecursedirs = .cache