[1.5.x] Avoided unneeded assertion on Python 3
Fixes failure introduced in 02e5909f7a
.
This commit is contained in:
parent
5921f15c11
commit
1b54c85a53
|
@ -13,7 +13,7 @@ from django.core.management import call_command
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.test.utils import override_settings
|
from django.test.utils import override_settings
|
||||||
from django.utils.encoding import force_str
|
from django.utils.encoding import force_str
|
||||||
from django.utils.six import binary_type, StringIO
|
from django.utils.six import binary_type, PY3, StringIO
|
||||||
|
|
||||||
|
|
||||||
def mock_inputs(inputs):
|
def mock_inputs(inputs):
|
||||||
|
@ -26,8 +26,9 @@ def mock_inputs(inputs):
|
||||||
class mock_getpass:
|
class mock_getpass:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getpass(prompt=b'Password: ', stream=None):
|
def getpass(prompt=b'Password: ', stream=None):
|
||||||
# getpass on Windows only supports prompt as bytestring (#19807)
|
if not PY3:
|
||||||
assert isinstance(prompt, binary_type)
|
# getpass on Windows only supports prompt as bytestring (#19807)
|
||||||
|
assert isinstance(prompt, binary_type)
|
||||||
return inputs['password']
|
return inputs['password']
|
||||||
|
|
||||||
def mock_input(prompt):
|
def mock_input(prompt):
|
||||||
|
|
Loading…
Reference in New Issue