diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-03-22 23:16:03 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-03-22 23:16:03 +0000 |
| commit | 3bb68004ff600930e181c190d06d79254f5a1b9c (patch) | |
| tree | f1af27cacbab9667e6ab72bafc7016bca28b259c /tests/regressiontests/conditional_processing | |
| parent | 14b160957e2965669e241f4640dd42a0fc412ec4 (diff) | |
Fixed #10581 -- Fixed conditional handling of If-Match headers.
The conditional processing decorator from r10114 wasn't parsing ETags
from an If-Match header correctly. Patch from Ivan Sagalaev (who also
did most of the work in r10114, before I rewrote parts of it and added
bonus bugs, although I forgot to thank him there).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10116 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/conditional_processing')
| -rw-r--r-- | tests/regressiontests/conditional_processing/models.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/regressiontests/conditional_processing/models.py b/tests/regressiontests/conditional_processing/models.py index 5c52acbd52..120a673859 100644 --- a/tests/regressiontests/conditional_processing/models.py +++ b/tests/regressiontests/conditional_processing/models.py @@ -50,6 +50,14 @@ class ConditionalGet(TestCase): response = self.client.get('/condition/') self.assertNotModified(response) + def testIfMatch(self): + self.client.defaults['HTTP_IF_MATCH'] = '"%s"' % ETAG + response = self.client.put('/condition/etag/', {'data': ''}) + self.assertEquals(response.status_code, 200) + self.client.defaults['HTTP_IF_MATCH'] = '"%s"' % EXPIRED_ETAG + response = self.client.put('/condition/etag/', {'data': ''}) + self.assertEquals(response.status_code, 412) + def testBothHeaders(self): self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG |
