1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.

This commit is contained in:
za
2016-10-27 14:53:39 +07:00
committed by Tim Graham
parent 4bb70cbcc6
commit 321e94fa41
185 changed files with 1216 additions and 1528 deletions

View File

@@ -111,8 +111,8 @@ class RequestURLConfTests(SimpleTestCase):
@override_settings(ROOT_URLCONF='i18n.patterns.urls.path_unused')
class PathUnusedTests(URLTestCaseBase):
"""
Check that if no i18n_patterns is used in root URLconfs, then no
language activation happens based on url prefix.
If no i18n_patterns is used in root URLconfs, then no language activation
activation happens based on url prefix.
"""
def test_no_lang_activate(self):
@@ -235,8 +235,7 @@ class URLRedirectTests(URLTestCaseBase):
class URLVaryAcceptLanguageTests(URLTestCaseBase):
"""
Tests that 'Accept-Language' is not added to the Vary header when using
prefixed URLs.
'Accept-Language' is not added to the Vary header when using prefixed URLs.
"""
def test_no_prefix_response(self):
response = self.client.get('/not-prefixed/')

View File

@@ -214,7 +214,7 @@ class BasicExtractorTests(ExtractorTests):
)
with self.assertRaisesMessage(SyntaxError, msg):
management.call_command('makemessages', locale=[LOCALE], extensions=['tpl'], verbosity=0)
# Check that the temporary file was cleaned up
# The temporary file was cleaned up
self.assertFalse(os.path.exists('./templates/template_with_error.tpl.py'))
def test_unicode_decode_error(self):
@@ -237,9 +237,8 @@ class BasicExtractorTests(ExtractorTests):
def test_template_message_context_extractor(self):
"""
Ensure that message contexts are correctly extracted for the
{% trans %} and {% blocktrans %} template tags.
Refs #14806.
Message contexts are correctly extracted for the {% trans %} and
{% blocktrans %} template tags (#14806).
"""
management.call_command('makemessages', locale=[LOCALE], verbosity=0)
self.assertTrue(os.path.exists(self.PO_FILE))
@@ -350,7 +349,7 @@ class BasicExtractorTests(ExtractorTests):
def test_makemessages_find_files(self):
"""
Test that find_files only discover files having the proper extensions.
find_files only discover files having the proper extensions.
"""
cmd = MakeMessagesCommand()
cmd.ignore_patterns = ['CVS', '.*', '*~', '*.pyc']
@@ -695,9 +694,8 @@ class CustomLayoutExtractionTests(ExtractorTests):
def test_project_locale_paths(self):
"""
Test that:
* translations for an app containing a locale folder are stored in that folder
* translations outside of that app are in LOCALE_PATHS[0]
* translations for an app containing a locale folder are stored in that folder
* translations outside of that app are in LOCALE_PATHS[0]
"""
with override_settings(LOCALE_PATHS=[os.path.join(self.test_dir, 'project_locale')]):
management.call_command('makemessages', locale=[LOCALE], verbosity=0)

View File

@@ -35,7 +35,7 @@ class ExtractingStringsWithPercentSigns(POFileAssertionMixin, FrenchTestCase):
"""
Tests the extracted string found in the gettext catalog.
Ensures that percent signs are python formatted.
Percent signs are python formatted.
These tests should all have an analogous translation tests below, ensuring
the python formatting does not persist through to a rendered template.

View File

@@ -107,8 +107,8 @@ class TranslationTests(SimpleTestCase):
def test_override_exit(self):
"""
Test that the language restored is the one used when the function was
called, not the one used when the decorator was initialized. refs #23381
The language restored is the one used when the function was
called, not the one used when the decorator was initialized (#23381).
"""
activate('fr')
@@ -267,9 +267,8 @@ class TranslationTests(SimpleTestCase):
@override_settings(LOCALE_PATHS=extended_locale_paths)
def test_template_tags_pgettext(self):
"""
Ensure that message contexts are taken into account the {% trans %} and
{% blocktrans %} template tags.
Refs #14806.
Message contexts are taken into account the {% trans %} and
{% blocktrans %} template tags (#14806).
"""
trans_real._active = local()
trans_real._translations = {}
@@ -726,10 +725,9 @@ class FormattingTests(SimpleTestCase):
def test_false_like_locale_formats(self):
"""
Ensure that the active locale's formats take precedence over the
default settings even if they would be interpreted as False in a
conditional test (e.g. 0 or empty string).
Refs #16938.
The active locale's formats take precedence over the default settings
even if they would be interpreted as False in a conditional test
(e.g. 0 or empty string) (#16938).
"""
with patch_formats('fr', THOUSAND_SEPARATOR='', FIRST_DAY_OF_WEEK=0):
with translation.override('fr'):
@@ -1152,7 +1150,7 @@ class FormattingTests(SimpleTestCase):
with translation.override('ru', deactivate=True):
# Russian locale has non-breaking space (\xa0) as thousand separator
# Check that usual space is accepted too when sanitizing inputs
# Usual space is accepted too when sanitizing inputs
with self.settings(USE_THOUSAND_SEPARATOR=True):
self.assertEqual(sanitize_separators('1\xa0234\xa0567'), '1234567')
self.assertEqual(sanitize_separators('77\xa0777,777'), '77777.777')
@@ -1514,8 +1512,8 @@ class MiscTests(SimpleTestCase):
@override_settings(LOCALE_PATHS=extended_locale_paths)
def test_percent_formatting_in_blocktrans(self):
"""
Test that using Python's %-formatting is properly escaped in blocktrans,
singular or plural
Python's %-formatting is properly escaped in blocktrans, singular or
plural.
"""
t_sing = Template("{% load i18n %}{% blocktrans %}There are %(num_comments)s comments{% endblocktrans %}")
t_plur = Template(
@@ -1531,8 +1529,8 @@ class MiscTests(SimpleTestCase):
def test_cache_resetting(self):
"""
#14170 after setting LANGUAGE, cache should be cleared and languages
previously valid should not be used.
After setting LANGUAGE, the cache should be cleared and languages
previously valid should not be used (#14170).
"""
g = get_language_from_request
r = self.rf.get('/')
@@ -1812,9 +1810,10 @@ class LocaleMiddlewareTests(TestCase):
],
)
def test_language_not_saved_to_session(self):
"""Checks that current language is not automatically saved to
session on every request."""
# Regression test for #21473
"""
The Current language isno' automatically saved to the session on every
request (#21473).
"""
self.client.get('/fr/simple/')
self.assertNotIn(LANGUAGE_SESSION_KEY, self.client.session)