summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-08-01 19:37:35 +0000
committerGerrit Code Review <review@openstack.org>2012-08-01 19:37:35 +0000
commitdb076de31eec46899fe2195d43a14beb9bb84073 (patch)
treeff32d6bcc9a749429141755e988e7c8d1e68338e /nova/tests
parentacb0f81f8ae99c4d726abbfb059d5be6e23f3075 (diff)
parentef579789065bd5eca90404e29463c63d538c5a01 (diff)
Merge "Fix issue with filtering where a value is unicode."
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_db_api.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py
index 344ac9a74..045f63e73 100644
--- a/nova/tests/test_db_api.py
+++ b/nova/tests/test_db_api.py
@@ -1,4 +1,5 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
+# encoding=UTF8
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
@@ -45,6 +46,14 @@ class DbApiTestCase(test.TestCase):
result = db.instance_get_all_by_filters(self.context, {})
self.assertTrue(2, len(result))
+ def test_instance_get_all_by_filters_unicode_value(self):
+ args = {'reservation_id': 'a', 'image_ref': 1, 'host': 'host1',
+ 'display_name': u'test♥'}
+ db.instance_create(self.context, args)
+ result = db.instance_get_all_by_filters(self.context.elevated(),
+ {'display_name': u'test'})
+ self.assertEqual(1, len(result))
+
def test_instance_get_all_by_filters_deleted(self):
args1 = {'reservation_id': 'a', 'image_ref': 1, 'host': 'host1'}
inst1 = db.instance_create(self.context, args1)