Skip to content

Commit acfcca4

Browse files
committed
Use unicode escape sequences, rather than actual UTF-8 characters in source code
1 parent ea59e19 commit acfcca4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

config_models/tests/test_config_models.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Tests of ConfigurationModel
43
"""
@@ -350,22 +349,22 @@ def test_key_string_values(self, mock_cache):
350349
""" Ensure str() vs unicode() doesn't cause duplicate cache entries """
351350
ExampleKeyedConfig(
352351
left='left',
353-
right=u'〉☃',
352+
right=u'\N{RIGHT ANGLE BRACKET}\N{SNOWMAN}',
354353
enabled=True,
355354
int_field=10,
356355
user=self.user,
357356
changed_by=self.user
358357
).save()
359358
mock_cache.get.return_value = None
360359

361-
entry = ExampleKeyedConfig.current('left', u'〉☃', self.user)
360+
entry = ExampleKeyedConfig.current('left', u'\N{RIGHT ANGLE BRACKET}\N{SNOWMAN}', self.user)
362361
key = mock_cache.get.call_args[0][0]
363362
self.assertEqual(entry.int_field, 10)
364363
mock_cache.get.assert_called_with(key)
365364
self.assertEqual(mock_cache.set.call_args[0][0], key)
366365

367366
mock_cache.get.reset_mock()
368-
entry = ExampleKeyedConfig.current(u'left', u'〉☃', self.user)
367+
entry = ExampleKeyedConfig.current(u'left', u'\N{RIGHT ANGLE BRACKET}\N{SNOWMAN}', self.user)
369368
self.assertEqual(entry.int_field, 10)
370369
mock_cache.get.assert_called_with(key)
371370

0 commit comments

Comments
 (0)