Ticket #3160: test_client_raw_post.patch
File test_client_raw_post.patch, 941 bytes (added by , 18 years ago) |
---|
-
django/test/client.py
176 187 177 188 return self.request(**r) 178 189 190 def raw_post(self, path, data="", type="application/x-www-url-encoded", 191 **extra): 192 """ 193 Request a response from the server using POST. Raw post data and a 194 content type argument are supplied and passed unmodified. 195 """ 196 r = { 197 'CONTENT_LENGTH': len(data), 198 'CONTENT_TYPE': type, 199 'PATH_INFO': path, 200 'REQUEST_METHOD': 'POST', 201 'wsgi.input': StringIO(data), 202 } 203 r.update(extra) 204 205 return self.request(**r) 206 179 207 def login(self, path, username, password, **extra): 180 208 """ 181 209 A specialized sequence of GET and POST to log into a view that