-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Add Django 5.0 support #9233
Add Django 5.0 support #9233
Conversation
I think you might to update the setup.py file as file |
sorry for taking soo long to respond! had other pro n personal priorities |
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 job so far. have some comments and suggestions to move forward
url_field = URLField(max_length=100) | ||
custom_field = ModelField(model_field=<tests.test_model_serializer.CustomField: custom_field>) | ||
file_path_field = FilePathField(path=%r) | ||
expected = dedent(r""" |
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.
usage of regex instead of old string format seems interesting to me. can you share more insight about it? pros and cons regarding this PR?
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.
The need arises from the integer validator generated from Django 5 integer fields. That validator breaks the assertion against the repr. In other tests, there is a conditional on Django version, an "if" to add the extra string to match. I find regex to be more flexible against changes that are not the object of the test - i.e. the correct functionality asserted from the repr in which the integer validator does not play a role. This would also prevent cluttering if, in future versions of Django, similar changes arrive (preventing the discussion for each version).
The cons I find would be the escaping cluttering in the strings because otherwise, it is pretty straight with the current testing suite ("the dedent of strings for testing the repr" way) and not harder to read.
This PR (based on #9230) fixes the test suite for supporting Django 5.0, enables it on the CI, and updates the documentation.
It also fixes the tests for djangomain (up to django/django@e412d85)