diff --git a/django/contrib/auth/management/commands/createsuperuser.py b/django/contrib/auth/management/commands/createsuperuser.py
index f462d95..ac2835d 100644
|
a
|
b
|
class Command(BaseCommand):
|
| 122 | 122 | while password is None: |
| 123 | 123 | if not password: |
| 124 | 124 | password = getpass.getpass() |
| 125 | | password2 = getpass.getpass('Password (again): ') |
| | 125 | password2 = getpass.getpass(force_str('Password (again): ')) |
| 126 | 126 | if password != password2: |
| 127 | 127 | self.stderr.write("Error: Your passwords didn't match.") |
| 128 | 128 | password = None |
diff --git a/django/contrib/auth/tests/basic.py b/django/contrib/auth/tests/basic.py
index 03af1fd..3c7bcff 100644
|
a
|
b
|
from django.core.management import call_command
|
| 13 | 13 | from django.test import TestCase |
| 14 | 14 | from django.test.utils import override_settings |
| 15 | 15 | from django.utils.encoding import force_str |
| 16 | | from django.utils.six import StringIO |
| | 16 | from django.utils.six import binary_type, StringIO |
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | def mock_inputs(inputs): |
| … |
… |
def mock_inputs(inputs):
|
| 24 | 24 | def inner(test_func): |
| 25 | 25 | def wrapped(*args): |
| 26 | 26 | class mock_getpass: |
| 27 | | pass |
| 28 | | mock_getpass.getpass = staticmethod(lambda p=None: inputs['password']) |
| | 27 | @staticmethod |
| | 28 | def getpass(prompt=b'Password: ', stream=None): |
| | 29 | # getpass on Windows only supports prompt as bytestring (#19807) |
| | 30 | assert isinstance(prompt, binary_type) |
| | 31 | return inputs['password'] |
| 29 | 32 | |
| 30 | 33 | def mock_input(prompt): |
| 31 | 34 | # prompt should be encoded in Python 2. This line will raise an |