Removed unnecessary numeric indexes in format strings.
This commit is contained in:
parent
5cef2cd4a1
commit
aa12cf07c9
|
@ -93,7 +93,7 @@ class UserPassesTestMixin(AccessMixin):
|
||||||
|
|
||||||
def test_func(self):
|
def test_func(self):
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
'{0} is missing the implementation of the test_func() method.'.format(self.__class__.__name__)
|
'{} is missing the implementation of the test_func() method.'.format(self.__class__.__name__)
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_test_func(self):
|
def get_test_func(self):
|
||||||
|
|
|
@ -970,7 +970,7 @@ def do_if(parser, token):
|
||||||
|
|
||||||
# {% endif %}
|
# {% endif %}
|
||||||
if token.contents != 'endif':
|
if token.contents != 'endif':
|
||||||
raise TemplateSyntaxError('Malformed template tag at line {0}: "{1}"'.format(token.lineno, token.contents))
|
raise TemplateSyntaxError('Malformed template tag at line {}: "{}"'.format(token.lineno, token.contents))
|
||||||
|
|
||||||
return IfNode(conditions_nodelists)
|
return IfNode(conditions_nodelists)
|
||||||
|
|
||||||
|
|
|
@ -656,7 +656,7 @@ class Client(RequestFactory):
|
||||||
if not hasattr(response, '_json'):
|
if not hasattr(response, '_json'):
|
||||||
if not JSON_CONTENT_TYPE_RE.match(response.get('Content-Type')):
|
if not JSON_CONTENT_TYPE_RE.match(response.get('Content-Type')):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
'Content-Type header is "{0}", not "application/json"'
|
'Content-Type header is "{}", not "application/json"'
|
||||||
.format(response.get('Content-Type'))
|
.format(response.get('Content-Type'))
|
||||||
)
|
)
|
||||||
response._json = json.loads(response.content.decode(response.charset), **extra)
|
response._json = json.loads(response.content.decode(response.charset), **extra)
|
||||||
|
|
|
@ -883,7 +883,7 @@ class DateTimePickerSeleniumTests(AdminWidgetSeleniumTestCase):
|
||||||
|
|
||||||
# Get the expected caption
|
# Get the expected caption
|
||||||
may_translation = month_name
|
may_translation = month_name
|
||||||
expected_caption = '{0:s} {1:d}'.format(may_translation.upper(), 1984)
|
expected_caption = '{:s} {:d}'.format(may_translation.upper(), 1984)
|
||||||
|
|
||||||
# Test with every locale
|
# Test with every locale
|
||||||
with override_settings(LANGUAGE_CODE=language_code, USE_L10N=True):
|
with override_settings(LANGUAGE_CODE=language_code, USE_L10N=True):
|
||||||
|
|
|
@ -49,7 +49,7 @@ class DTModel(models.Model):
|
||||||
duration = models.DurationField(null=True, blank=True)
|
duration = models.DurationField(null=True, blank=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return 'DTModel({0})'.format(self.name)
|
return 'DTModel({})'.format(self.name)
|
||||||
|
|
||||||
|
|
||||||
class DecimalModel(models.Model):
|
class DecimalModel(models.Model):
|
||||||
|
|
|
@ -319,7 +319,7 @@ class GDALRasterTests(SimpleTestCase):
|
||||||
return
|
return
|
||||||
gdalinfo = """
|
gdalinfo = """
|
||||||
Driver: GTiff/GeoTIFF
|
Driver: GTiff/GeoTIFF
|
||||||
Files: {0}
|
Files: {}
|
||||||
Size is 163, 174
|
Size is 163, 174
|
||||||
Coordinate System is:
|
Coordinate System is:
|
||||||
PROJCS["NAD83 / Florida GDL Albers",
|
PROJCS["NAD83 / Florida GDL Albers",
|
||||||
|
|
|
@ -153,13 +153,13 @@ simple_tag_without_context_parameter.anything = "Expected simple_tag_without_con
|
||||||
@register.simple_tag(takes_context=True)
|
@register.simple_tag(takes_context=True)
|
||||||
def escape_naive(context):
|
def escape_naive(context):
|
||||||
"""A tag that doesn't even think about escaping issues"""
|
"""A tag that doesn't even think about escaping issues"""
|
||||||
return "Hello {0}!".format(context['name'])
|
return "Hello {}!".format(context['name'])
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag(takes_context=True)
|
@register.simple_tag(takes_context=True)
|
||||||
def escape_explicit(context):
|
def escape_explicit(context):
|
||||||
"""A tag that uses escape explicitly"""
|
"""A tag that uses escape explicitly"""
|
||||||
return escape("Hello {0}!".format(context['name']))
|
return escape("Hello {}!".format(context['name']))
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag(takes_context=True)
|
@register.simple_tag(takes_context=True)
|
||||||
|
|
Loading…
Reference in New Issue