-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deprecation warnings #5680
Fix deprecation warnings #5680
Conversation
…o modelcluster.contrib.taggit
… removed in 3.5, use html.unescape() instead.
Using (?i) in url() patterns is deprecated in Django 2.1
@cwdavies could you look at the test coverage failures? It's probably only failing because you touched those files and they don't have full coverage, not because of changes you made specifically. But I think it'd be good to add coverage as we find places like that. |
This file is concerning which I will attempt to address: |
…login_views.LoginViewsTestCase
https://docs.djangoproject.com/en/stable/ref/contrib/redirects/ Django comes with an optional redirects application. It lets you store redirects in a database and handles the redirecting for you. It uses the HTTP response status code 301 Moved Permanently by default. class HttpResponsePermanentRedirect¶ |
…admin_views.TestExportFeedbackView
This change asserts that the URL gets redirected to lower-case from mixed case, but because the lowercase URL doesn't necessarily exist, it does not fetch the resulting response.
@cwdavies I figured out the right incantation and pushed a change to the tests to use |
When tox is run with
python -Wd
there are a multitude of deprecation warnings loggedThe following changes are made to fix many of these deprecations:
assertRaisesRegexp
toassertRaisesRegex
assertRegexMatch
withassertRegex
assertEquals
toassertEqual
warn
method is deprecated, usewarning
insteadmodelcluster.tags
module has been moved tomodelcluster.contrib.taggit
unescape
method is deprecated and will be removed in 3.5, usehtml.unescape()
instead.imp
module is deprecated in favour ofimportlib
is_safe_url
used inlogin_with_lockout
inv1\view\__init__.py
for Django 2.2_post_feedback
inv1\tests\handlers\blocks\test_feedback.py
to fix:TypeError: Cannot encode None as POST data
Additions
handle_404_error
incfgov/urls.py
test handle_404_error
incfgov/tests/test_urls.py
test_handle_404_error_case_insensitive_redirect
incfgov/tests/test_urls.py
Removals
Testing
Update
tox.ini
to add-Wd
option to python command line as follows:python -b -Wd -m coverage run --source='.' manage.py test {posargs}
Notes
Checklist