Opened 9 years ago

Closed 8 years ago

#3212 closed defect (fixed)

[patch] Client.post() doesn't support multiple values for form values

Reported by: ben <ben.dean.kawamura@…> Owned by: russellm
Component: Testing framework Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Client.post doesn't support multi-valued form values. This makes it hard to use with MultipleChoiceField objects. Here's a patch that lets you accomplish that by using lists or tuples in Client.post(), for example:

c = django.test.client.Client()
c.post("/myurl/", {'foo': [1,2,3]})

Attachments (1)

multi-form-values.diff (660 bytes) - added by ben <ben.dean.kawamura@…> 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by ben <ben.dean.kawamura@…>

comment:1 Changed 9 years ago by ben <ben.dean.kawamura@…>

  • Component changed from Admin interface to Unit test system

comment:2 Changed 9 years ago by russellm

  • Owner changed from adrian to russellm

comment:3 Changed 8 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(In [4774]) Fixes #3212 -- Added code to test client to allow posting of multi-form values (e.g., MultipleChoiceFields). Thanks, Ben Dean Kawamura.

Note: See TracTickets for help on using tickets.
Back to Top