#30089: TestClient doesn't accept data with duplicate keys (SELECT multiple)
---------------------------------------------+------------------------
Reporter: adamgilman | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version: 2.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
---------------------------------------------+------------------------
When constructing tests for forms with SELECT elements which allow
multiple item selection, the test client doesn't accept multiple
selections due to the fact it uses dict internally and results in a
squashed single key
Failing test
{{{#!python
def test_post_multi_select(self):
"POST SELECT multiple data to a view"
post_data = QueryDict(mutable=True)
post_data.update({'value':37})
post_data.update({'value':37})
response = self.client.post('/post_view/', post_data)
# Check some response details
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['data'], ['37', '38'])
self.assertEqual(response.templates[0].name, 'POST Template')
self.assertContains(response, 'Data received')
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30089>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.4cf1232b8374093a6e161b1095d65c6a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.