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 all deprecation warnings #385
Conversation
…ield.remote_field.model
@@ -56,7 +57,22 @@ def _get_form_str(self, form_str): | |||
return form_str | |||
|
|||
def assert_form_renders(self, form, html): | |||
self.assertHTMLEqual(str(form), self._get_form_str(html)) | |||
# Django causes a DeprecationWarning on Python 3.3, 3.4 | |||
if (3, 3) >= sys.version_info > (3, 5): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this always evaluate to False
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Which means if the DeprecationWarnings are not appearing, that particular issue must have gone away... I'll look in to it.
f36bbe0
to
4f482a0
Compare
I fixed the backwards conditional that you spotted, properly silencing the DeprecationWarning from Django in those versions of Python. |
Sorry for the delay! Thanks a bunch, your contributions are greatly appreciated ✨ |
I've fixed all deprecation warnings from all versions of Django supported by taggit, while maintaining backwards compatibility with all currently supported versions, and with all tests passing.
This involved adding some helpers for the recently renamed
field.rel.to
/field.remote_field.model
, and changing the use ofadd_lazy_relation
tolazy_related_operation
on Django 1.9.SQL names are quoted using the correct function now, fixing #380 and #383.
on_delete=models.CASCADE
has been added to all ForeignKeys where it was missing, including in tests and migrations. This is backwards compatible with current code and projects, ason_delete=models.CASCADE
was the assumed default previously.Warnings due to different versions of unittest bundled through different version of Django have been sorted out, as has a warning from Django for Python 3.3, 3.4.
Finally, DeprecationWarnings are now show in test output. As there are no more deprecation warnings, the test output is still useable as it is before, without being polluted with lots of DeprecationWarning noise.