Replaced unnecessary str()/bytes() calls with literals.
This commit is contained in:
parent
e649d691f8
commit
57a3d96ff5
|
@ -282,9 +282,9 @@ class BaseDatabaseSchemaEditor:
|
||||||
default = field.get_default()
|
default = field.get_default()
|
||||||
elif not field.null and field.blank and field.empty_strings_allowed:
|
elif not field.null and field.blank and field.empty_strings_allowed:
|
||||||
if field.get_internal_type() == "BinaryField":
|
if field.get_internal_type() == "BinaryField":
|
||||||
default = bytes()
|
default = b''
|
||||||
else:
|
else:
|
||||||
default = str()
|
default = ''
|
||||||
elif getattr(field, 'auto_now', False) or getattr(field, 'auto_now_add', False):
|
elif getattr(field, 'auto_now', False) or getattr(field, 'auto_now_add', False):
|
||||||
default = datetime.now()
|
default = datetime.now()
|
||||||
internal_type = field.get_internal_type()
|
internal_type = field.get_internal_type()
|
||||||
|
|
|
@ -250,7 +250,7 @@ class LiveServerPort(LiveServerBase):
|
||||||
|
|
||||||
def test_specified_port_bind(self):
|
def test_specified_port_bind(self):
|
||||||
"""LiveServerTestCase.port customizes the server's port."""
|
"""LiveServerTestCase.port customizes the server's port."""
|
||||||
TestCase = type(str('TestCase'), (LiveServerBase,), {})
|
TestCase = type('TestCase', (LiveServerBase,), {})
|
||||||
# Find an open port and tell TestCase to use it.
|
# Find an open port and tell TestCase to use it.
|
||||||
s = socket.socket()
|
s = socket.socket()
|
||||||
s.bind(('', 0))
|
s.bind(('', 0))
|
||||||
|
|
Loading…
Reference in New Issue