Merge pull request #196 from felixxm/issue-django2.0-stdout-bytes

Removed unnecessary `stdout` bytes encode.
This commit is contained in:
Camilo Nova 2017-02-02 07:58:42 -05:00 committed by GitHub
commit 61d32d2f9e
5 changed files with 6 additions and 6 deletions

View file

@ -46,7 +46,7 @@ class Command(BaseCommand):
if command == 'get':
try:
self.stdout.write("{}".format(getattr(config, key)).encode('utf-8'), ending=b"\n")
self.stdout.write("{}".format(getattr(config, key)), ending="\n")
except AttributeError as e:
raise CommandError(key + " is not defined in settings.CONSTANCE_CONFIG")
@ -64,4 +64,4 @@ class Command(BaseCommand):
elif command == 'list':
for k, v in get_values().items():
self.stdout.write("{}\t{}".format(k, v).encode('utf-8'), ending=b"\n")
self.stdout.write("{}\t{}".format(k, v), ending="\n")

View file

@ -64,7 +64,7 @@ CONSTANCE_CONFIG = {
'LONG_VALUE': (long_value, 'some looong int'),
'BOOL_VALUE': (True, 'true or false'),
'STRING_VALUE': ('Hello world', 'greetings'),
'UNICODE_VALUE': (u'Rivière-Bonjour', 'greetings'),
'UNICODE_VALUE': (u'Rivière-Bonjour რუსთაველი', 'greetings'),
'DECIMAL_VALUE': (Decimal('0.1'), 'the first release version'),
'DATETIME_VALUE': (datetime(2010, 8, 23, 11, 29, 24),
'time of the first commit'),

View file

@ -22,7 +22,7 @@ class StorageTestsMixin(object):
self.assertEqual(self.config.LONG_VALUE, long(123456))
self.assertEqual(self.config.BOOL_VALUE, True)
self.assertEqual(self.config.STRING_VALUE, 'Hello world')
self.assertEqual(self.config.UNICODE_VALUE, u'Rivière-Bonjour')
self.assertEqual(self.config.UNICODE_VALUE, u'Rivière-Bonjour რუსთაველი')
self.assertEqual(self.config.DECIMAL_VALUE, Decimal('0.1'))
self.assertEqual(self.config.DATETIME_VALUE, datetime(2010, 8, 23, 11, 29, 24))
self.assertEqual(self.config.FLOAT_VALUE, 3.1415926536)

View file

@ -33,7 +33,7 @@ u""" BOOL_VALUE True
TIME_VALUE 23:59:59
LONG_VALUE 123456
STRING_VALUE Hello world
UNICODE_VALUE Rivière-Bonjour
UNICODE_VALUE Rivière-Bonjour რუსთაველი
CHOICE_VALUE yes
DECIMAL_VALUE 0.1
DATETIME_VALUE 2010-08-23 11:29:24

View file

@ -30,7 +30,7 @@ class UtilsTestCase(TestCase):
'LINEBREAK_VALUE': 'Spam spam',
'DECIMAL_VALUE': Decimal('0.1'),
'STRING_VALUE': 'Hello world',
'UNICODE_VALUE': u'Rivière-Bonjour',
'UNICODE_VALUE': u'Rivière-Bonjour რუსთაველი',
'DATETIME_VALUE': datetime.datetime(2010, 8, 23, 11, 29, 24),
'LONG_VALUE': 123456
})