Fix test failures with Django 4.x
The wsgi.input environment variable is expected to be a stream. Closes-Bug: #2034952 Change-Id: I602449245b30d5375251bd7138f538f28068a16a
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
import collections.abc
|
||||
import copy
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import socket
|
||||
@@ -200,7 +201,8 @@ class TestCase(django_test.TestCase):
|
||||
The expected number of messages can be specified per message type.
|
||||
Usage would look like ``self.assertMessageCount(success=1)``.
|
||||
"""
|
||||
temp_req = self.client.request(**{'wsgi.input': None})
|
||||
stream = wsgi.LimitedStream(io.BytesIO(), 2)
|
||||
temp_req = self.client.request(**{'wsgi.input': stream})
|
||||
temp_req.COOKIES = self.client.cookies
|
||||
storage = default_storage(temp_req)
|
||||
messages = []
|
||||
|
Reference in New Issue
Block a user