#31533: Test client request's post body can be read multiple times, unlike real
requests
-----------------------------------+--------------------------------------
Reporter: Ben Beecher | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Comment (by Ichlasul Affan):
Hi Ben,
Django's {{{django.test.Client}}} is a browser-like simulator. Each time
you run {{{self.client.post}}, {{self.client.get}}, etc., {{{Client}}}
will create a new, different request even though the body is the same.
Are you using {{{djoser}}}? If yes, I think that's not how you use
{{{djoser}}} properly. You just need to set up {{{djoser}}} in your
{{{settings.py}}} and {{{urls.py}}}, then use that URL to create tokens or
something else. You don't need to recall {{{djoser}}}'s view inside your
view using your own request intended for your view, it will be
problemmatic in some places.
--
Ticket URL: <https://code.djangoproject.com/ticket/31533#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/062.e90ebc6d49c81734c60fa94322d81844%40djangoproject.com.