diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-04-18 07:46:05 -0700 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-04-20 12:10:33 +0200 |
| commit | 505fec6badba0622bbf97bb659188c3d62a9bc58 (patch) | |
| tree | ca5c256eb32d7f9906c59652049a45690458b52b /tests | |
| parent | 3152146e3abd029be2457d2e780599d399db0fe2 (diff) | |
Capitalized Unicode in docs, strings, and comments.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/admin_scripts/tests.py | 2 | ||||
| -rw-r--r-- | tests/admin_views/models.py | 6 | ||||
| -rw-r--r-- | tests/admin_views/tests.py | 8 | ||||
| -rw-r--r-- | tests/auth_tests/test_basic.py | 2 | ||||
| -rw-r--r-- | tests/backends/tests.py | 4 | ||||
| -rw-r--r-- | tests/custom_pk/tests.py | 2 | ||||
| -rw-r--r-- | tests/file_uploads/views.py | 2 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_utils.py | 2 | ||||
| -rw-r--r-- | tests/forms_tests/tests/tests.py | 2 | ||||
| -rw-r--r-- | tests/handlers/tests.py | 2 | ||||
| -rw-r--r-- | tests/httpwrappers/tests.py | 3 | ||||
| -rw-r--r-- | tests/mail/tests.py | 2 | ||||
| -rw-r--r-- | tests/responses/test_cookie.py | 2 | ||||
| -rw-r--r-- | tests/template_tests/syntax_tests/test_autoescape.py | 2 | ||||
| -rw-r--r-- | tests/test_utils/tests.py | 4 | ||||
| -rw-r--r-- | tests/utils_tests/test_text.py | 2 | ||||
| -rw-r--r-- | tests/view_tests/tests/test_i18n.py | 2 |
17 files changed, 25 insertions, 24 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 6266619216..222d55f023 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -570,7 +570,7 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase): self.assertTrue(os.path.exists(os.path.join(app_path, 'api.py'))) def test_startapp_unicode_name(self): - "directory: startapp creates the correct directory with unicode characters" + """startapp creates the correct directory with Unicode characters.""" args = ['startapp', 'こんにちは'] app_path = os.path.join(self.test_dir, 'こんにちは') out, err = self.run_django_admin(args, 'test_project.settings') diff --git a/tests/admin_views/models.py b/tests/admin_views/models.py index 16dd58bcd3..ba818ea10e 100644 --- a/tests/admin_views/models.py +++ b/tests/admin_views/models.py @@ -458,12 +458,12 @@ class PrePopulatedSubPost(models.Model): class Post(models.Model): - title = models.CharField(max_length=100, help_text="Some help text for the title (with unicode ŠĐĆŽćžšđ)") - content = models.TextField(help_text="Some help text for the content (with unicode ŠĐĆŽćžšđ)") + title = models.CharField(max_length=100, help_text='Some help text for the title (with Unicode ŠĐĆŽćžšđ)') + content = models.TextField(help_text='Some help text for the content (with Unicode ŠĐĆŽćžšđ)') readonly_content = models.TextField() posted = models.DateField( default=datetime.date.today, - help_text="Some help text for the date (with unicode ŠĐĆŽćžšđ)" + help_text='Some help text for the date (with Unicode ŠĐĆŽćžšđ)', ) public = models.BooleanField(null=True, blank=True) diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 8fde8ed45c..37818f7f65 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -4842,17 +4842,17 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase): self.assertContains(response, '<div class="help">', 3) self.assertContains( response, - '<div class="help">Some help text for the title (with unicode ŠĐĆŽćžšđ)</div>', + '<div class="help">Some help text for the title (with Unicode ŠĐĆŽćžšđ)</div>', html=True ) self.assertContains( response, - '<div class="help">Some help text for the content (with unicode ŠĐĆŽćžšđ)</div>', + '<div class="help">Some help text for the content (with Unicode ŠĐĆŽćžšđ)</div>', html=True ) self.assertContains( response, - '<div class="help">Some help text for the date (with unicode ŠĐĆŽćžšđ)</div>', + '<div class="help">Some help text for the date (with Unicode ŠĐĆŽćžšđ)</div>', html=True ) @@ -4962,7 +4962,7 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase): response = self.client.get(reverse('admin:admin_views_fieldoverridepost_change', args=(p.pk,))) self.assertContains(response, '<div class="help">Overridden help text for the date</div>') self.assertContains(response, '<label for="id_public">Overridden public label:</label>', html=True) - self.assertNotContains(response, "Some help text for the date (with unicode ŠĐĆŽćžšđ)") + self.assertNotContains(response, 'Some help text for the date (with Unicode ŠĐĆŽćžšđ)') def test_correct_autoescaping(self): """ diff --git a/tests/auth_tests/test_basic.py b/tests/auth_tests/test_basic.py index 9e0d8e863e..4cba35eb41 100644 --- a/tests/auth_tests/test_basic.py +++ b/tests/auth_tests/test_basic.py @@ -44,7 +44,7 @@ class BasicTestCase(TestCase): def test_unicode_username(self): User.objects.create_user('jörg') User.objects.create_user('Григорий') - # Two equivalent unicode normalized usernames should be duplicates + # Two equivalent Unicode normalized usernames are duplicates. omega_username = 'iamtheΩ' # U+03A9 GREEK CAPITAL LETTER OMEGA ohm_username = 'iamtheΩ' # U+2126 OHM SIGN User.objects.create_user(ohm_username) diff --git a/tests/backends/tests.py b/tests/backends/tests.py index 40fc6de7fc..08bdac3437 100644 --- a/tests/backends/tests.py +++ b/tests/backends/tests.py @@ -317,7 +317,7 @@ class BackendTestCase(TransactionTestCase): self.assertEqual(Square.objects.count(), 9) def test_unicode_fetches(self): - # fetchone, fetchmany, fetchall return strings as unicode objects #6254 + # fetchone, fetchmany, fetchall return strings as Unicode objects. qn = connection.ops.quote_name Person(first_name="John", last_name="Doe").save() Person(first_name="Jane", last_name="Doe").save() @@ -349,7 +349,7 @@ class BackendTestCase(TransactionTestCase): # As password is probably wrong, a database exception is expected pass except Exception as e: - self.fail("Unexpected error raised with unicode password: %s" % e) + self.fail('Unexpected error raised with Unicode password: %s' % e) finally: connection.settings_dict['PASSWORD'] = old_password diff --git a/tests/custom_pk/tests.py b/tests/custom_pk/tests.py index da0cff14cc..934ed248ea 100644 --- a/tests/custom_pk/tests.py +++ b/tests/custom_pk/tests.py @@ -187,7 +187,7 @@ class CustomPKTests(TestCase): Business.objects.create(pk="Tears") def test_unicode_pk(self): - # Primary key may be unicode string + # Primary key may be Unicode string. Business.objects.create(name='jaźń') def test_unique_pk(self): diff --git a/tests/file_uploads/views.py b/tests/file_uploads/views.py index 36c9fc12a2..ff381c0a05 100644 --- a/tests/file_uploads/views.py +++ b/tests/file_uploads/views.py @@ -54,7 +54,7 @@ def file_upload_view_verify(request): def file_upload_unicode_name(request): - # Check to see if unicode name came through properly. + # Check to see if Unicode name came through properly. if not request.FILES['file_unicode'].name.endswith(UNICODE_FILENAME): return HttpResponseServerError() # Check to make sure the exotic characters are preserved even diff --git a/tests/forms_tests/tests/test_utils.py b/tests/forms_tests/tests/test_utils.py index c849bfd262..ea0949920e 100644 --- a/tests/forms_tests/tests/test_utils.py +++ b/tests/forms_tests/tests/test_utils.py @@ -59,7 +59,7 @@ class FormsUtilsTestCase(SimpleTestCase): str(ErrorList(ValidationError("There was an error.").messages)), '<ul class="errorlist"><li>There was an error.</li></ul>' ) - # Can take a unicode string. + # Can take a Unicode string. self.assertHTMLEqual( str(ErrorList(ValidationError("Not \u03C0.").messages)), '<ul class="errorlist"><li>Not π.</li></ul>' diff --git a/tests/forms_tests/tests/tests.py b/tests/forms_tests/tests/tests.py index de04e8a3bc..18b4c58b5e 100644 --- a/tests/forms_tests/tests/tests.py +++ b/tests/forms_tests/tests/tests.py @@ -150,7 +150,7 @@ class ModelFormCallableModelDefault(TestCase): class FormsModelTestCase(TestCase): def test_unicode_filename(self): - # FileModel with unicode filename and data ######################### + # FileModel with Unicode filename and data ######################### file1 = SimpleUploadedFile('我隻氣墊船裝滿晒鱔.txt', 'मेरी मँडराने वाली नाव सर्पमीनों से भरी ह'.encode()) f = FileForm(data={}, files={'file1': file1}, auto_id=False) self.assertTrue(f.is_valid()) diff --git a/tests/handlers/tests.py b/tests/handlers/tests.py index 3d322ec6ed..3b655a91c2 100644 --- a/tests/handlers/tests.py +++ b/tests/handlers/tests.py @@ -50,7 +50,7 @@ class HandlerTests(SimpleTestCase): environ['QUERY_STRING'] = str(raw_query_string, 'iso-8859-1') request = WSGIRequest(environ) got.append(request.GET['want']) - # %E9 is converted to the unicode replacement character by parse_qsl + # %E9 is converted to the Unicode replacement character by parse_qsl self.assertEqual(got, ['café', 'café', 'caf\ufffd', 'café']) def test_non_ascii_cookie(self): diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py index bafdd2891c..04c2a9516c 100644 --- a/tests/httpwrappers/tests.py +++ b/tests/httpwrappers/tests.py @@ -302,7 +302,8 @@ class HttpResponseTests(unittest.TestCase): r['key'] = 'café' self.assertIn('café'.encode('latin-1'), r.serialize_headers()) - # Other unicode values are MIME-encoded (there's no way to pass them as bytes). + # Other Unicode values are MIME-encoded (there's no way to pass them as + # bytes). r['key'] = '†' self.assertEqual(r['key'], '=?utf-8?b?4oCg?=') self.assertIn(b'=?utf-8?b?4oCg?=', r.serialize_headers()) diff --git a/tests/mail/tests.py b/tests/mail/tests.py index 84aa8dc498..1f8c6b12bf 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -302,7 +302,7 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): def test_unicode_address_header(self): """ - Regression for #11144 - When a to/from/cc header contains unicode, + Regression for #11144 - When a to/from/cc header contains Unicode, make sure the email addresses are parsed correctly (especially with regards to commas) """ diff --git a/tests/responses/test_cookie.py b/tests/responses/test_cookie.py index 36cb43ed81..a52443eefe 100644 --- a/tests/responses/test_cookie.py +++ b/tests/responses/test_cookie.py @@ -73,7 +73,7 @@ class SetCookieTests(SimpleTestCase): self.assertIs(example_cookie['httponly'], True) def test_unicode_cookie(self): - """HttpResponse.set_cookie() works with unicode data.""" + """HttpResponse.set_cookie() works with Unicode data.""" response = HttpResponse() cookie_value = '清風' response.set_cookie('test', cookie_value) diff --git a/tests/template_tests/syntax_tests/test_autoescape.py b/tests/template_tests/syntax_tests/test_autoescape.py index 810731978b..e684bc94bd 100644 --- a/tests/template_tests/syntax_tests/test_autoescape.py +++ b/tests/template_tests/syntax_tests/test_autoescape.py @@ -36,7 +36,7 @@ class AutoescapeTagTests(SimpleTestCase): output = self.engine.render_to_string('autoescape-tag05', {'first': '<b>first</b>'}) self.assertEqual(output, '<b>first</b>') - # Strings (ASCII or unicode) already marked as "safe" are not + # Strings (ASCII or Unicode) already marked as "safe" are not # auto-escaped @setup({'autoescape-tag06': '{{ first }}'}) def test_autoescape_tag06(self): diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 59f8ddd26b..4e90d720ee 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -806,10 +806,10 @@ class HTMLEqualTests(SimpleTestCase): self.assertContains(response, '<p "whats" that>') def test_unicode_handling(self): - response = HttpResponse('<p class="help">Some help text for the title (with unicode ŠĐĆŽćžšđ)</p>') + response = HttpResponse('<p class="help">Some help text for the title (with Unicode ŠĐĆŽćžšđ)</p>') self.assertContains( response, - '<p class="help">Some help text for the title (with unicode ŠĐĆŽćžšđ)</p>', + '<p class="help">Some help text for the title (with Unicode ŠĐĆŽćžšđ)</p>', html=True ) diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py index 66dbd5b366..9dbf9367c3 100644 --- a/tests/utils_tests/test_text.py +++ b/tests/utils_tests/test_text.py @@ -189,7 +189,7 @@ class TestUtilsText(SimpleTestCase): def test_slugify(self): items = ( - # given - expected - unicode? + # given - expected - Unicode? ('Hello, World!', 'hello-world', False), ('spam & eggs', 'spam-eggs', False), ('spam & ıçüş', 'spam-ıçüş', True), diff --git a/tests/view_tests/tests/test_i18n.py b/tests/view_tests/tests/test_i18n.py index dd07aa9f93..fcbffa711d 100644 --- a/tests/view_tests/tests/test_i18n.py +++ b/tests/view_tests/tests/test_i18n.py @@ -252,7 +252,7 @@ class I18NViewTests(SimpleTestCase): self.assertEqual(response['Content-Type'], 'text/javascript; charset="utf-8"') # response content must include a line like: # "this is to be translated": <value of trans_txt Python variable> - # json.dumps() is used to be able to check unicode strings + # json.dumps() is used to be able to check Unicode strings. self.assertContains(response, json.dumps(trans_txt), 1) if lang_code == 'fr': # Message with context (msgctxt) |
