﻿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
16235	Test client flatens POST data	emdonahu@…	nobody	"Under normal production conditions, request.POST returns a QueryDict corresponding to the query parameters, like so:
{{{
<QueryDict: {u'my_key': [u'my_value']}>
}}}

However, when running a post request from the test client via 
{{{
python manage.py test
}}}

the post data gets flattened into a single string that is unparsable by the QueryDict, resulting in this:
{{{
<QueryDict: {u""{'my_key': ['my_value']}"": [u'']}> #the whole parameter dictionary is flattened into a string
}}}

Currently, the data dict is serialized by the smart_str function, which only seems to be intended for encoding strings. The result is an encoded but unformatted serialized post_data string that eventually reaches the QueryDict constructor, but does not present a format that QueryDict respects. If this not in fact the intended behavior, the most straight-forward fix would seem to be urlencoding the data dict prior to serialization. A patch representative of this suggestion is attached. For further presentation of the issue, refer to [http://stackoverflow.com/questions/6315960/djangos-querydict-bizarre-behavior-bunches-post-dictionary-into-a-single-key]."	Bug	closed	Testing framework	1.3	Normal	invalid	test client, querydict		Unreviewed	1	0	1	0	0	0
