From 7d289274880f4d10b936c622d978bf26e0d7849e Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Thu, 4 Feb 2016 21:01:22 +0000 Subject: [PATCH] Use unicode strings in description fields Change-Id: I3c1fd87b57bb01e557ed2f52f89575c9be2e518d --- designate/tests/__init__.py | 6 +++--- designate/tests/test_central/test_service.py | 8 ++++---- designate/tests/test_storage/__init__.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/designate/tests/__init__.py b/designate/tests/__init__.py index 1f6663d25..cdccd231f 100644 --- a/designate/tests/__init__.py +++ b/designate/tests/__init__.py @@ -197,7 +197,7 @@ class TestCase(base.BaseTestCase): blacklist_fixtures = [{ 'pattern': 'blacklisted.com.', - 'description': 'This is a comment', + 'description': u'This is a comment', }, { 'pattern': 'blacklisted.net.' }, { @@ -206,13 +206,13 @@ class TestCase(base.BaseTestCase): pool_fixtures = [ {'name': 'Pool-One', - 'description': 'Pool-One description', + 'description': u'Pool-One description', 'attributes': [{'key': 'scope', 'value': 'public'}], 'ns_records': [{'priority': 1, 'hostname': 'ns1.example.org.'}, {'priority': 2, 'hostname': 'ns2.example.org.'}]}, {'name': 'Pool-Two', - 'description': 'Pool-Two description', + 'description': u'Pool-Two description', 'attributes': [{'key': 'scope', 'value': 'public'}], 'ns_records': [{'priority': 1, 'hostname': 'ns1.example.org.'}]}, ] diff --git a/designate/tests/test_central/test_service.py b/designate/tests/test_central/test_service.py index 22783bc3f..ceb6eec9e 100644 --- a/designate/tests/test_central/test_service.py +++ b/designate/tests/test_central/test_service.py @@ -2675,7 +2675,7 @@ class CentralServiceTest(CentralTestCase): blacklist = self.create_blacklist(fixture=0) # Update the Object - blacklist.description = "New Comment" + blacklist.description = u"New Comment" # Perform the update self.central_service.update_blacklist(self.admin_context, blacklist) @@ -2685,7 +2685,7 @@ class CentralServiceTest(CentralTestCase): blacklist.id) # Verify that the record was updated correctly - self.assertEqual("New Comment", blacklist.description) + self.assertEqual(u"New Comment", blacklist.description) def test_delete_blacklist(self): # Create a blacklisted zone @@ -2871,14 +2871,14 @@ class CentralServiceTest(CentralTestCase): pool = self.create_pool(fixture=0) # Update and save the pool - pool.description = 'New Comment' + pool.description = u'New Comment' self.central_service.update_pool(self.admin_context, pool) # Fetch the pool pool = self.central_service.get_pool(self.admin_context, pool.id) # Verify that the pool was updated correctly - self.assertEqual("New Comment", pool.description) + self.assertEqual(u"New Comment", pool.description) def test_update_pool_add_ns_record(self): # Create a server pool and zone diff --git a/designate/tests/test_storage/__init__.py b/designate/tests/test_storage/__init__.py index 2a35502f5..bae40213a 100644 --- a/designate/tests/test_storage/__init__.py +++ b/designate/tests/test_storage/__init__.py @@ -1509,7 +1509,7 @@ class StorageTestCase(object): def test_create_tld(self): values = { 'name': 'com', - 'description': 'This is a comment.' + 'description': u'This is a comment.' } result = self.storage.create_tld( @@ -1664,7 +1664,7 @@ class StorageTestCase(object): def test_create_blacklist(self): values = { 'pattern': "^([A-Za-z0-9_\\-]+\\.)*example\\.com\\.$", - 'description': "This is a comment." + 'description': u"This is a comment." } result = self.storage.create_blacklist(