Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
support django 2.1+ test client json data automatically serialized#6511
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
support django 2.1+ test client json data automatically serialized#6511
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
to have a better review need to add a test for the proposed change.
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.
I'm definitely going to agree with@auvipy here. A test case demonstrating the behavior change would be required for this to be accepted.
My immediate reaction is "why aren't our tests failing under Django 2.1+?"
4607f28
to4ed1e0e
Compare@rpkilby updated with a test |
d368885
to0a99e02
CompareThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
0a99e02
to9ee6d46
CompareUpdated to |
9ee6d46
to09fafd2
CompareThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
09fafd2
tod28724e
Comparebumped, I think the failed test was unrelated but this re-run the test suite |
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.
also, please rebase, and I think we might get rid of some checks to eleminate older version check
Uh oh!
There was an error while loading.Please reload this page.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
d28724e
tod579cc1
CompareThe failing test should be fixed by#9129 |
auvipy left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
can you rebase? and check if any document or test update is needed to get this merged? also a reference to django docs related to this would be really helpful
d579cc1
to803e089
Compareterencehonles commentedOct 5, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
It's mentioned herehttps://docs.djangoproject.com/en/4.2/topics/testing/tools/#django.test.Client.post(specifically), and it's mentioned in the 2.1 release noteshttps://docs.djangoproject.com/en/4.2/releases/2.1/#tests (point 2) I'm not sure if you're asking for this to be included in the source, since there's not specifically a good place to put it (maybe the tests?), or if you're just asking for the release notes. |
@auvipy friendly ping, I can rebase, but wondering about ^^^ |
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.
looks good to me. should we also mention this in DRF docs?
Sure, I'll rebase and mention it. One thing that I realized with this request factory, when testing something yesterday, is that it returns a Django not a DRF request. This means that trying to access the I will look at the code, but would it be acceptable to return a DRF request instead? It proxies the native request so it's not a breaking change. I will look at the code, but from memory I think I can actually initialize it in way that would make sense. I will also look at the test client to make sure it does not rely on the factory or that if it does it works correctly. |
803e089
to4579eae
CompareI've left out changing the return type to |
Thanks, will review it again soon |
089f6a6
intoencode:masterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Description
_encode_data
is alwaysTuple[bytes, str]
rather thanTuple[Union[bytes,str], str]