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 |
auvipy
left a comment
There was a problem hiding this comment.
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.
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.
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)