diff options
| author | Claude Paroz <claude@2xlibre.net> | 2017-03-04 15:47:49 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2017-03-04 18:18:21 +0100 |
| commit | 8346680e1ca4a8ddc8190baf3f5f944f6418d5cf (patch) | |
| tree | ed12bc1d1077a65c1b32d410bc267266f6e3e4f9 /tests | |
| parent | 86de930f413e0ad902e11d78ac988e6743202ea6 (diff) | |
Refs #27795 -- Removed unneeded force_text calls
Thanks Tim Graham for the review.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/mail/tests.py | 2 | ||||
| -rw-r--r-- | tests/migrations/test_state.py | 2 | ||||
| -rw-r--r-- | tests/model_fields/models.py | 2 | ||||
| -rw-r--r-- | tests/postgres_tests/test_hstore.py | 4 | ||||
| -rw-r--r-- | tests/string_lookup/tests.py | 3 | ||||
| -rw-r--r-- | tests/utils_tests/test_text.py | 5 |
6 files changed, 4 insertions, 14 deletions
diff --git a/tests/mail/tests.py b/tests/mail/tests.py index 63737b3462..a9d9885650 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -635,8 +635,6 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): # Simple ASCII address - string form self.assertEqual(sanitize_address('to@example.com', 'ascii'), 'to@example.com') self.assertEqual(sanitize_address('to@example.com', 'utf-8'), 'to@example.com') - # Bytestrings are transformed to normal strings. - self.assertEqual(sanitize_address(b'to@example.com', 'utf-8'), 'to@example.com') # Simple ASCII address - tuple form self.assertEqual( diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py index badd45a5aa..fe9c4fd03a 100644 --- a/tests/migrations/test_state.py +++ b/tests/migrations/test_state.py @@ -359,7 +359,7 @@ class StateTests(SimpleTestCase): # The ordering we really want is objects, mgr1, mgr2 ('default', base_mgr), ('food_mgr2', mgr2), - (b'food_mgr1', mgr1), + ('food_mgr1', mgr1), ] )) diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py index 134d200be9..f6e94a841e 100644 --- a/tests/model_fields/models.py +++ b/tests/model_fields/models.py @@ -30,7 +30,7 @@ def get_foo(): class Bar(models.Model): b = models.CharField(max_length=10) - a = models.ForeignKey(Foo, models.CASCADE, default=get_foo, related_name=b'bars') + a = models.ForeignKey(Foo, models.CASCADE, default=get_foo, related_name='bars') class Whiz(models.Model): diff --git a/tests/postgres_tests/test_hstore.py b/tests/postgres_tests/test_hstore.py index 2c6f93f1f6..09d2de1017 100644 --- a/tests/postgres_tests/test_hstore.py +++ b/tests/postgres_tests/test_hstore.py @@ -42,8 +42,8 @@ class SimpleTests(HStoreTestCase): self.assertEqual(reloaded.field, value) def test_key_val_cast_to_string(self): - value = {'a': 1, 'b': 'B', 2: 'c', 'ï': 'ê', b'x': b'test'} - expected_value = {'a': '1', 'b': 'B', '2': 'c', 'ï': 'ê', 'x': 'test'} + value = {'a': 1, 'b': 'B', 2: 'c', 'ï': 'ê'} + expected_value = {'a': '1', 'b': 'B', '2': 'c', 'ï': 'ê'} instance = HStoreModel.objects.create(field=value) instance = HStoreModel.objects.get() diff --git a/tests/string_lookup/tests.py b/tests/string_lookup/tests.py index 22b0c6b9cf..a8e39dbb6c 100644 --- a/tests/string_lookup/tests.py +++ b/tests/string_lookup/tests.py @@ -51,9 +51,6 @@ class StringLookupTests(TestCase): fx.save() self.assertEqual(Foo.objects.get(friend__contains='\xe7'), fx) - # We can also do the above query using UTF-8 strings. - self.assertEqual(Foo.objects.get(friend__contains=b'\xc3\xa7'), fx) - def test_queries_on_textfields(self): """ Regression tests for #5087 diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py index 465db554da..ed189cd2e9 100644 --- a/tests/utils_tests/test_text.py +++ b/tests/utils_tests/test_text.py @@ -157,11 +157,6 @@ class TestUtilsText(SimpleTestCase): self.assertEqual(text.normalize_newlines(""), "") self.assertEqual(text.normalize_newlines(lazystr("abc\ndef\rghi\r\n")), "abc\ndef\nghi\n") - def test_normalize_newlines_bytes(self): - """normalize_newlines should be able to handle bytes too""" - normalized = text.normalize_newlines(b"abc\ndef\rghi\r\n") - self.assertEqual(normalized, "abc\ndef\nghi\n") - def test_phone2numeric(self): numeric = text.phone2numeric('0800 flowers') self.assertEqual(numeric, '0800 3569377') |
