mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.
This commit is contained in:
parent
4bb70cbcc6
commit
321e94fa41
185 changed files with 1216 additions and 1528 deletions
|
@ -56,14 +56,10 @@ class FunctionTests(SimpleTestCase):
|
|||
self.assertEqual(floatformat(None), '')
|
||||
|
||||
def test_zero_values(self):
|
||||
"""
|
||||
Check that we're not converting to scientific notation.
|
||||
"""
|
||||
self.assertEqual(floatformat(0, 6), '0.000000')
|
||||
self.assertEqual(floatformat(0, 7), '0.0000000')
|
||||
self.assertEqual(floatformat(0, 10), '0.0000000000')
|
||||
self.assertEqual(floatformat(0.000000000000000000015, 20),
|
||||
'0.00000000000000000002')
|
||||
self.assertEqual(floatformat(0.000000000000000000015, 20), '0.00000000000000000002')
|
||||
|
||||
def test_infinity(self):
|
||||
pos_inf = float(1e30000)
|
||||
|
|
|
@ -27,8 +27,7 @@ class JoinTests(SimpleTestCase):
|
|||
output = self.engine.render_to_string('join04', {'a': ['alpha', 'beta & me']})
|
||||
self.assertEqual(output, 'alpha & beta & me')
|
||||
|
||||
# #11377 Test that joining with unsafe joiners doesn't result in
|
||||
# unsafe strings
|
||||
# Joining with unsafe joiners doesn't result in unsafe strings.
|
||||
@setup({'join05': '{{ a|join:var }}'})
|
||||
def test_join05(self):
|
||||
output = self.engine.render_to_string('join05', {'a': ['alpha', 'beta & me'], 'var': ' & '})
|
||||
|
|
|
@ -54,7 +54,7 @@ class TimesinceTests(TimezoneTestCase):
|
|||
)
|
||||
self.assertEqual(output, '1\xa0minute')
|
||||
|
||||
# Check that timezone is respected
|
||||
# Timezone is respected
|
||||
@setup({'timesince06': '{{ a|timesince:b }}'})
|
||||
def test_timesince06(self):
|
||||
output = self.engine.render_to_string('timesince06', {'a': self.now_tz - timedelta(hours=8), 'b': self.now_tz})
|
||||
|
@ -83,7 +83,7 @@ class TimesinceTests(TimezoneTestCase):
|
|||
output = self.engine.render_to_string('timesince10', {'now': self.now, 'later': self.now + timedelta(days=7)})
|
||||
self.assertEqual(output, '0\xa0minutes')
|
||||
|
||||
# Ensures that differing timezones are calculated correctly.
|
||||
# Differing timezones are calculated correctly.
|
||||
@setup({'timesince11': '{{ a|timesince }}'})
|
||||
def test_timesince11(self):
|
||||
output = self.engine.render_to_string('timesince11', {'a': self.now})
|
||||
|
|
|
@ -70,7 +70,7 @@ class TimeuntilTests(TimezoneTestCase):
|
|||
output = self.engine.render_to_string('timeuntil09', {'now': self.now, 'later': self.now + timedelta(days=7)})
|
||||
self.assertEqual(output, '1\xa0week')
|
||||
|
||||
# Ensures that differing timezones are calculated correctly.
|
||||
# Differing timezones are calculated correctly.
|
||||
@requires_tz_support
|
||||
@setup({'timeuntil10': '{{ a|timeuntil }}'})
|
||||
def test_timeuntil10(self):
|
||||
|
|
|
@ -87,7 +87,7 @@ class ForTagTests(SimpleTestCase):
|
|||
@setup({'for-tag-unpack09': '{% for val in items %}{{ val.0 }}:{{ val.1 }}/{% endfor %}'})
|
||||
def test_for_tag_unpack09(self):
|
||||
"""
|
||||
Ensure that a single loopvar doesn't truncate the list in val.
|
||||
A single loopvar doesn't truncate the list in val.
|
||||
"""
|
||||
output = self.engine.render_to_string('for-tag-unpack09', {'items': (('one', 1), ('two', 2))})
|
||||
self.assertEqual(output, 'one:1/two:2/')
|
||||
|
|
|
@ -226,7 +226,7 @@ class IncludeTests(SimpleTestCase):
|
|||
|
||||
def test_include_missing_template(self):
|
||||
"""
|
||||
Tests that the correct template is identified as not existing
|
||||
The correct template is identified as not existing
|
||||
when {% include %} specifies a template that does not exist.
|
||||
"""
|
||||
engine = Engine(app_dirs=True, debug=True)
|
||||
|
@ -237,7 +237,7 @@ class IncludeTests(SimpleTestCase):
|
|||
|
||||
def test_extends_include_missing_baseloader(self):
|
||||
"""
|
||||
#12787 -- Tests that the correct template is identified as not existing
|
||||
#12787 -- The correct template is identified as not existing
|
||||
when {% extends %} specifies a template that does exist, but that
|
||||
template has an {% include %} of something that does not exist.
|
||||
"""
|
||||
|
|
|
@ -116,7 +116,7 @@ class ContextTests(SimpleTestCase):
|
|||
def test_render_context(self):
|
||||
test_context = RenderContext({'fruit': 'papaya'})
|
||||
|
||||
# Test that push() limits access to the topmost dict
|
||||
# push() limits access to the topmost dict
|
||||
test_context.push()
|
||||
|
||||
test_context['vegetable'] = 'artichoke'
|
||||
|
|
|
@ -127,7 +127,8 @@ class SimpleTagTests(TagTestCase):
|
|||
self.assertEqual(t.render(c), "Hello Jack & Jill!")
|
||||
|
||||
def test_simple_tag_registration(self):
|
||||
# Test that the decorators preserve the decorated function's docstring, name and attributes.
|
||||
# The decorators preserve the decorated function's docstring, name,
|
||||
# and attributes.
|
||||
self.verify_tag(custom.no_params, 'no_params')
|
||||
self.verify_tag(custom.one_param, 'one_param')
|
||||
self.verify_tag(custom.explicit_no_context, 'explicit_no_context')
|
||||
|
@ -257,7 +258,8 @@ class InclusionTagTests(TagTestCase):
|
|||
self.assertEqual(t.render(c), entry[1])
|
||||
|
||||
def test_inclusion_tag_registration(self):
|
||||
# Test that the decorators preserve the decorated function's docstring, name and attributes.
|
||||
# The decorators preserve the decorated function's docstring, name,
|
||||
# and attributes.
|
||||
self.verify_tag(inclusion.inclusion_no_params, 'inclusion_no_params')
|
||||
self.verify_tag(inclusion.inclusion_one_param, 'inclusion_one_param')
|
||||
self.verify_tag(inclusion.inclusion_explicit_no_context, 'inclusion_explicit_no_context')
|
||||
|
@ -273,7 +275,7 @@ class InclusionTagTests(TagTestCase):
|
|||
|
||||
def test_15070_use_l10n(self):
|
||||
"""
|
||||
Test that inclusion tag passes down `use_l10n` of context to the
|
||||
Inclusion tag passes down `use_l10n` of context to the
|
||||
Context of the included/rendered template as well.
|
||||
"""
|
||||
c = Context({})
|
||||
|
@ -313,7 +315,8 @@ class AssignmentTagTests(TagTestCase):
|
|||
self.assertEqual(t.render(c), 'The result is: assignment_no_params - Expected result')
|
||||
|
||||
def test_assignment_tag_registration(self):
|
||||
# Test that the decorators preserve the decorated function's docstring, name and attributes.
|
||||
# The decorators preserve the decorated function's docstring, name,
|
||||
# and attributes.
|
||||
self.verify_tag(custom.assignment_no_params, 'assignment_no_params')
|
||||
|
||||
def test_assignment_tag_missing_context(self):
|
||||
|
|
|
@ -30,7 +30,7 @@ class LoaderTests(SimpleTestCase):
|
|||
|
||||
def test_loader_priority(self):
|
||||
"""
|
||||
#21460 -- Check that the order of template loader works.
|
||||
#21460 -- The order of template loader works.
|
||||
"""
|
||||
loaders = [
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
|
@ -42,7 +42,7 @@ class LoaderTests(SimpleTestCase):
|
|||
|
||||
def test_cached_loader_priority(self):
|
||||
"""
|
||||
Check that the order of template loader works. Refs #21460.
|
||||
The order of template loader works. Refs #21460.
|
||||
"""
|
||||
loaders = [
|
||||
('django.template.loaders.cached.Loader', [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue