Ticket #14753: 14753.diff

File 14753.diff, 539 bytes (added by ojii, 5 years ago)

fix for this issue

  • django/test/client.py

    diff --git a/django/test/client.py b/django/test/client.py
    index 203828a..24fe627 100644
    a b class FakePayload(object): 
    4646
    4747    def read(self, num_bytes=None):
    4848        if num_bytes is None:
    49             num_bytes = self.__len or 1
     49            num_bytes = self.__len or 0
    5050        assert self.__len >= num_bytes, "Cannot read more than the available bytes from the HTTP incoming data."
    5151        content = self.__content.read(num_bytes)
    5252        self.__len -= num_bytes
Back to Top