mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #17371 -- Made the test client more flexible
The OPTIONS, PUT and DELETE methods no longer apply arbitrary data encoding (in the query string or in the request body).
This commit is contained in:
parent
323b414441
commit
e73838b6dd
5 changed files with 93 additions and 81 deletions
|
@ -63,10 +63,10 @@ class ConditionalGet(TestCase):
|
|||
|
||||
def testIfMatch(self):
|
||||
self.client.defaults['HTTP_IF_MATCH'] = '"%s"' % ETAG
|
||||
response = self.client.put('/condition/etag/', {'data': ''})
|
||||
response = self.client.put('/condition/etag/')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.client.defaults['HTTP_IF_MATCH'] = '"%s"' % EXPIRED_ETAG
|
||||
response = self.client.put('/condition/etag/', {'data': ''})
|
||||
response = self.client.put('/condition/etag/')
|
||||
self.assertEqual(response.status_code, 412)
|
||||
|
||||
def testBothHeaders(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue