Opened 5 years ago
Closed 5 years ago
#30677 closed Cleanup/optimization (fixed)
Improve Exception Message In Test Client and urlencode() when None is passed as data.
Reported by: | Keith Gray | Owned by: | Swatantra |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | test client post |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
I am upgrading to 2.2.1 from 2.0.5 and my tests are failing due to a change in the test client: https://docs.djangoproject.com/en/2.2/releases/2.2/#miscellaneous. It now throws an exception if a None value is provided in data given to a POST. I would like to propose an improvement to the message to display the offending Key and Value that generate the exception.
I have a proposed change in my fork on github: https://github.com/idahogray/django/tree/ticket_30677
Change History (11)
comment:1 by , 5 years ago
Description: | modified (diff) |
---|---|
Has patch: | set |
comment:2 by , 5 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 5 years ago
Has patch: | unset |
---|---|
Summary: | Improve Exception Message In Test Client when a None Value is provided to a POST → Improve Exception Message In Test Client when a None Value is provided to a POST. |
Version: | 2.2 → master |
I agree with Markus' suggestion. Can you create PR via GitHub?
comment:4 by , 5 years ago
I will change the wording and create a PR. I have one more question, can I use f-strings since this is going into master? I cloned the repo and tried to run the tests in a Python 3.5 environment but it wouldn't let me.
comment:5 by , 5 years ago
Django 3.0 supports Python 3.6+, nevertheless please don't use f-strings (see #29988).
comment:6 by , 5 years ago
Easy pickings: | set |
---|
comment:7 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:9 by , 5 years ago
Patch needs improvement: | unset |
---|---|
Summary: | Improve Exception Message In Test Client when a None Value is provided to a POST. → Improve Exception Message In Test Client and urlencode() when None is passed as data. |
Triage Stage: | Accepted → Ready for checkin |
comment:10 by , 5 years ago
Sorry for the delayed response, i was traveling this week. Thanks for picking this up.
I like your suggestion. I would suggest a slightly different wording: