﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29268	Support passing None to test Client and RequestFactory request methods for default content_type	Chris Jerdonek	Anurag Verma	"Currently, passing `content_type=None` to [https://github.com/django/django/blob/76ae1e9a94cbfddbbf115ad96f26901ba5c02d44/django/test/client.py#L532 `test.Client.post()`] results in the following error:

{{{
TypeError: expected string or bytes-like object
}}}

instead of causing the default `content_type` value. It would be more user-friendly if passing `None` resulted in the default value.

One reason is as follows. Currently, if one wants to create a wrapper function around `post()` with the same default behavior, the user either needs to (1) duplicate / hard-code the default value in their wrapper function, or (2) special-case `None` with a second invocation of `post()` using a different function signature (i.e. one that doesn't pass //any// `content_type` value). You can even see this happening in `client.py` with the way that `Client.post()` invokes `RequestFactory.post()` -- the default needs to be hard-coded twice.
"	Cleanup/optimization	assigned	Testing framework	2.0	Normal				Accepted	1	0	0	0	0	0
