~roadmr/canonical-identity-provider/update-raven

« back to all changes in this revision

Viewing changes to src/identityprovider/tests/test_views_server.py

  • Committer: Ubuntu One Auto Copilot
  • Author(s): Daniel Manrique
  • Date: 2018-05-30 20:44:05 UTC
  • mfrom: (1633.1.26 fix-deprecation-warnings-3)
  • Revision ID: otto-copilot@canonical.com-20180530204405-dnj6rlkmn8feffjq
Fix most remaining Django and Python deprecation warnings in the sso codebase itself.

Some of the remaining ones probably need fixing in dependencies:
- django-statsd
- django-openid-auth
- django-piston
- django-honeypot
- raven
- preflight
- oauthlib

Other than the ones from dependencies, the remaining deprecation warnings are:

- most of the middlewares. RemovedInDjango20Warning: Old-style middleware using settings.MIDDLEWARE_CLASSES is deprecated. Update your middleware and use settings.MIDDLEWARE instead.
- identityprovider/models/twofactor.py:103: RemovedInDjango20Warning: Using user.is_authenticated() and user.is_anonymous() as a method is deprecated. Remove the parentheses to use it as an attribute. This needs updating django-openid-auth to make its is_authenticated method an attribute, to avoid ugly "is it callable?" logic in SSO itself.

Merged from https://code.launchpad.net/~roadmr/canonical-identity-provider/fix-deprecation-warnings-3/+merge/347154

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
from django.contrib import messages
13
13
from django.contrib.auth.models import AnonymousUser
14
14
from django.core.cache import cache
15
 
from django.core.urlresolvers import reverse
16
15
from django.http import HttpRequest
17
16
from django.test.utils import override_settings, patch_logger
 
17
from django.urls import reverse
18
18
from django.utils.timezone import now
19
19
from gargoyle.testutils import switches
20
20
from mock import Mock