diff --git a/django/http/__init__.py b/django/http/__init__.py
index 683212f..3a067c0 100644
a
|
b
|
class HttpResponse(object):
|
371 | 371 | content = property(_get_content, _set_content) |
372 | 372 | |
373 | 373 | def __iter__(self): |
374 | | self._iterator = iter(self._container) |
375 | | return self |
376 | | |
377 | | def next(self): |
378 | | chunk = self._iterator.next() |
379 | | if isinstance(chunk, unicode): |
380 | | chunk = chunk.encode(self._charset) |
381 | | return str(chunk) |
| 374 | for chunk in self._container: |
| 375 | if isinstance(chunk, unicode): |
| 376 | chunk = chunk.encode(self._charset) |
| 377 | yield str(chunk) |
382 | 378 | |
383 | 379 | def close(self): |
384 | 380 | if hasattr(self._container, 'close'): |
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py
index 04099be..99727bf 100644
a
|
b
|
BadHeaderError: Header values can't contain newlines (got 'test\\nstr')
|
463 | 463 | >>> x.update(y) |
464 | 464 | >>> x.getlist('a') |
465 | 465 | [u'1', u'2', u'3', u'4'] |
| 466 | |
| 467 | # |
| 468 | # Regression test for #13222: HttpResponse iteration |
| 469 | # |
| 470 | >>> it = iter(HttpResponse("foobar")) |
| 471 | >>> list(it), list(it) |
| 472 | (['foobar'], []) |
466 | 473 | """ |
467 | 474 | |
468 | 475 | from django.http import QueryDict, HttpResponse |