Opened 9 years ago

Closed 9 years ago

#3160 closed enhancement (fixed)

Make raw post (e.g. XML) with django.test.client.Client more convinient

Reported by: afternoon@… Owned by: russellm
Component: Testing framework Version: master
Severity: normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:

Description

As described in this mailing list thread adding a raw_post method to the test Client class would allow simple posting of raw data, such as XML or JSON, to views. This would make testing AJAX views and views that communicate with other agents than browsers easier.

Attachments (2)

test_client_raw_post.patch (941 bytes) - added by afternoon@… 9 years ago.
[patch] Add raw_post method to django.test.client.Client
test_client_raw_post_v2.patch (4.6 KB) - added by anonymous 9 years ago.
Revised version of raw_post patch, includes tests and docs

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by afternoon@…

[patch] Add raw_post method to django.test.client.Client

comment:1 Changed 9 years ago by anonymous

  • Needs documentation set
  • Needs tests set

comment:2 Changed 9 years ago by anonymous

  • Has patch set

comment:3 Changed 9 years ago by SmileyChris

  • Triage Stage changed from Unreviewed to Design decision needed

Changed 9 years ago by anonymous

Revised version of raw_post patch, includes tests and docs

comment:4 Changed 9 years ago by russellm

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

(In [4529]) Fixed #3160 -- Added the ability to control the content type in a test client POST request. This is to allow easier testing of json-rpc/xml-rpc/soap etc interfaces. Thanks to Mikeal Rogers for the suggestion, and Ben <afternoon@…> for the patch.

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