mirror of
https://github.com/django/django.git
synced 2025-09-12 05:26:27 +00:00
Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
This commit is contained in:
parent
e63d98b7be
commit
c716fe8782
111 changed files with 305 additions and 1296 deletions
|
@ -3,7 +3,6 @@ import os
|
|||
|
||||
from django.db.backends.postgresql.client import DatabaseClient
|
||||
from django.test import SimpleTestCase, mock
|
||||
from django.utils import six
|
||||
from django.utils.encoding import force_bytes, force_str
|
||||
|
||||
|
||||
|
@ -91,16 +90,12 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase):
|
|||
encoding = locale.getpreferredencoding()
|
||||
username = 'rôle'
|
||||
password = 'sésame'
|
||||
try:
|
||||
username_str = force_str(username, encoding)
|
||||
password_str = force_str(password, encoding)
|
||||
pgpass_bytes = force_bytes(
|
||||
'somehost:444:dbname:%s:%s' % (username, password),
|
||||
encoding=encoding,
|
||||
)
|
||||
except UnicodeEncodeError:
|
||||
if six.PY2:
|
||||
self.skipTest("Your locale can't run this test.")
|
||||
username_str = force_str(username, encoding)
|
||||
password_str = force_str(password, encoding)
|
||||
pgpass_bytes = force_bytes(
|
||||
'somehost:444:dbname:%s:%s' % (username, password),
|
||||
encoding=encoding,
|
||||
)
|
||||
self.assertEqual(
|
||||
self._run_it({
|
||||
'database': 'dbname',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue