Ticket #5682: patch_django_5682_client.diff
File patch_django_5682_client.diff, 1.6 KB (added by , 17 years ago) |
---|
-
django_src/django/test/client.py
218 218 219 219 return self.request(**r) 220 220 221 def delete(self, path, data={}, **extra): 222 "Request a response from the server using DELETE." 223 r = { 224 'CONTENT_LENGTH': None, 225 'CONTENT_TYPE': 'text/html; charset=utf-8', 226 'PATH_INFO': path, 227 'QUERY_STRING': urlencode(data, doseq=True), 228 'REQUEST_METHOD': 'DELETE', 229 } 230 r.update(extra) 231 232 return self.request(**r) 233 221 234 def post(self, path, data={}, content_type=MULTIPART_CONTENT, **extra): 222 235 "Request a response from the server using POST." 223 236 … … 237 250 238 251 return self.request(**r) 239 252 253 def put(self, path, data={}, content_type=MULTIPART_CONTENT, **extra): 254 "Request a response from the server using PUT." 255 256 if content_type is MULTIPART_CONTENT: 257 put_data = encode_multipart(BOUNDARY, data) 258 else: 259 put_data = data 260 261 r = { 262 'CONTENT_LENGTH': len(put_data), 263 'CONTENT_TYPE': content_type, 264 'PATH_INFO': path, 265 'REQUEST_METHOD': 'PUT', 266 'wsgi.input': StringIO(put_data), 267 } 268 r.update(extra) 269 270 return self.request(**r) 271 240 272 def login(self, **credentials): 241 273 """Set the Client to appear as if it has sucessfully logged into a site. 242 274