Ticket #9163: 9163_alt_r9362.diff
File 9163_alt_r9362.diff, 1.1 KB (added by , 16 years ago) |
---|
-
django/http/__init__.py
360 360 361 361 def _set_content(self, value): 362 362 self._container = [value] 363 del self['ETag'] 363 364 self._is_string = True 364 365 365 366 content = property(_get_content, _set_content) -
tests/regressiontests/httpwrappers/tests.py
444 444 >>> x.update(y) 445 445 >>> x.getlist('a') 446 446 [u'1', u'2', u'3', u'4'] 447 448 # 449 # Regression test for #9163: should remove ETag if content is modified 450 # 451 >>> content = 'some content' 452 >>> hash = md5_constructor('some content').hexdigest() 453 >>> r = HttpResponse(content) 454 >>> r['ETag'] = hash 455 >>> r.content = 'new content' 456 >>> r.has_header('ETag') 457 False 458 447 459 """ 448 460 449 461 from django.http import QueryDict, HttpResponse 462 from django.utils.hashcompat import md5_constructor 450 463 451 464 if __name__ == "__main__": 452 465 import doctest