Use unicode strings in description fields
Change-Id: I3c1fd87b57bb01e557ed2f52f89575c9be2e518d
This commit is contained in:
parent
79a4af0455
commit
7d28927488
@ -197,7 +197,7 @@ class TestCase(base.BaseTestCase):
|
|||||||
|
|
||||||
blacklist_fixtures = [{
|
blacklist_fixtures = [{
|
||||||
'pattern': 'blacklisted.com.',
|
'pattern': 'blacklisted.com.',
|
||||||
'description': 'This is a comment',
|
'description': u'This is a comment',
|
||||||
}, {
|
}, {
|
||||||
'pattern': 'blacklisted.net.'
|
'pattern': 'blacklisted.net.'
|
||||||
}, {
|
}, {
|
||||||
@ -206,13 +206,13 @@ class TestCase(base.BaseTestCase):
|
|||||||
|
|
||||||
pool_fixtures = [
|
pool_fixtures = [
|
||||||
{'name': 'Pool-One',
|
{'name': 'Pool-One',
|
||||||
'description': 'Pool-One description',
|
'description': u'Pool-One description',
|
||||||
'attributes': [{'key': 'scope', 'value': 'public'}],
|
'attributes': [{'key': 'scope', 'value': 'public'}],
|
||||||
'ns_records': [{'priority': 1, 'hostname': 'ns1.example.org.'},
|
'ns_records': [{'priority': 1, 'hostname': 'ns1.example.org.'},
|
||||||
{'priority': 2, 'hostname': 'ns2.example.org.'}]},
|
{'priority': 2, 'hostname': 'ns2.example.org.'}]},
|
||||||
|
|
||||||
{'name': 'Pool-Two',
|
{'name': 'Pool-Two',
|
||||||
'description': 'Pool-Two description',
|
'description': u'Pool-Two description',
|
||||||
'attributes': [{'key': 'scope', 'value': 'public'}],
|
'attributes': [{'key': 'scope', 'value': 'public'}],
|
||||||
'ns_records': [{'priority': 1, 'hostname': 'ns1.example.org.'}]},
|
'ns_records': [{'priority': 1, 'hostname': 'ns1.example.org.'}]},
|
||||||
]
|
]
|
||||||
|
@ -2675,7 +2675,7 @@ class CentralServiceTest(CentralTestCase):
|
|||||||
blacklist = self.create_blacklist(fixture=0)
|
blacklist = self.create_blacklist(fixture=0)
|
||||||
|
|
||||||
# Update the Object
|
# Update the Object
|
||||||
blacklist.description = "New Comment"
|
blacklist.description = u"New Comment"
|
||||||
|
|
||||||
# Perform the update
|
# Perform the update
|
||||||
self.central_service.update_blacklist(self.admin_context, blacklist)
|
self.central_service.update_blacklist(self.admin_context, blacklist)
|
||||||
@ -2685,7 +2685,7 @@ class CentralServiceTest(CentralTestCase):
|
|||||||
blacklist.id)
|
blacklist.id)
|
||||||
|
|
||||||
# Verify that the record was updated correctly
|
# 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):
|
def test_delete_blacklist(self):
|
||||||
# Create a blacklisted zone
|
# Create a blacklisted zone
|
||||||
@ -2871,14 +2871,14 @@ class CentralServiceTest(CentralTestCase):
|
|||||||
pool = self.create_pool(fixture=0)
|
pool = self.create_pool(fixture=0)
|
||||||
|
|
||||||
# Update and save the pool
|
# Update and save the pool
|
||||||
pool.description = 'New Comment'
|
pool.description = u'New Comment'
|
||||||
self.central_service.update_pool(self.admin_context, pool)
|
self.central_service.update_pool(self.admin_context, pool)
|
||||||
|
|
||||||
# Fetch the pool
|
# Fetch the pool
|
||||||
pool = self.central_service.get_pool(self.admin_context, pool.id)
|
pool = self.central_service.get_pool(self.admin_context, pool.id)
|
||||||
|
|
||||||
# Verify that the pool was updated correctly
|
# 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):
|
def test_update_pool_add_ns_record(self):
|
||||||
# Create a server pool and zone
|
# Create a server pool and zone
|
||||||
|
@ -1509,7 +1509,7 @@ class StorageTestCase(object):
|
|||||||
def test_create_tld(self):
|
def test_create_tld(self):
|
||||||
values = {
|
values = {
|
||||||
'name': 'com',
|
'name': 'com',
|
||||||
'description': 'This is a comment.'
|
'description': u'This is a comment.'
|
||||||
}
|
}
|
||||||
|
|
||||||
result = self.storage.create_tld(
|
result = self.storage.create_tld(
|
||||||
@ -1664,7 +1664,7 @@ class StorageTestCase(object):
|
|||||||
def test_create_blacklist(self):
|
def test_create_blacklist(self):
|
||||||
values = {
|
values = {
|
||||||
'pattern': "^([A-Za-z0-9_\\-]+\\.)*example\\.com\\.$",
|
'pattern': "^([A-Za-z0-9_\\-]+\\.)*example\\.com\\.$",
|
||||||
'description': "This is a comment."
|
'description': u"This is a comment."
|
||||||
}
|
}
|
||||||
|
|
||||||
result = self.storage.create_blacklist(
|
result = self.storage.create_blacklist(
|
||||||
|
Loading…
Reference in New Issue
Block a user