mirror of
https://github.com/django/django.git
synced 2025-10-26 23:26:08 +00:00
Reverted 6a64822bf4.
This commit caused every test that does two or more assertContains to fail, because of #6527. It also made HttpResponse non-pickleable. Refs #13222.
This commit is contained in:
@@ -260,9 +260,9 @@ class HttpResponse(HttpResponseBase):
|
||||
else:
|
||||
self._container = [value]
|
||||
self._base_content_is_iter = False
|
||||
self._iterator = iter(self._container)
|
||||
|
||||
def __iter__(self):
|
||||
self._iterator = iter(self._container)
|
||||
return self
|
||||
|
||||
def __next__(self):
|
||||
@@ -284,7 +284,7 @@ class HttpResponse(HttpResponseBase):
|
||||
def tell(self):
|
||||
if self._base_content_is_iter:
|
||||
raise Exception("This %s instance cannot tell its position" % self.__class__.__name__)
|
||||
return len(self.content)
|
||||
return sum([len(chunk) for chunk in self])
|
||||
|
||||
|
||||
class StreamingHttpResponse(HttpResponseBase):
|
||||
|
||||
Reference in New Issue
Block a user