From 41e4a9b7716ffbb7525a580a40acc06c2325da74 Mon Sep 17 00:00:00 2001 From: Tom Barron Date: Wed, 9 Mar 2016 11:12:17 -0500 Subject: [PATCH] fix invalid uuid warnings from test_quota The test_quota unit tests are emitting several FutureWarnings [1] from oslo_versioned_objects due to use of invalid faked test values. This commit uses fake values from cinder/tests/unit/fake_constants.py to clean up this test module consistent with similar cleanups in the codebase. [1] http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField Change-Id: I57565145f425a6be92b7bbd3dfff2d04eb760cc6 --- cinder/tests/unit/test_quota.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cinder/tests/unit/test_quota.py b/cinder/tests/unit/test_quota.py index f9084f0fbbf..eeee62cf380 100644 --- a/cinder/tests/unit/test_quota.py +++ b/cinder/tests/unit/test_quota.py @@ -34,6 +34,7 @@ from cinder.objects import fields from cinder import quota from cinder import quota_utils from cinder import test +from cinder.tests.unit import fake_constants as fakes import cinder.tests.unit.image.fake from cinder import volume @@ -61,8 +62,8 @@ class QuotaIntegrationTestCase(test.TestCase): quota_backups=2, quota_backup_gigabytes=20) - self.user_id = 'admin' - self.project_id = 'admin' + self.user_id = fakes.user_id + self.project_id = fakes.project_id self.context = context.RequestContext(self.user_id, self.project_id, is_admin=True) @@ -90,8 +91,8 @@ class QuotaIntegrationTestCase(test.TestCase): def _create_snapshot(self, volume): snapshot = objects.Snapshot(self.context) - snapshot.user_id = self.user_id or 'fake_user_id' - snapshot.project_id = self.project_id or 'fake_project_id' + snapshot.user_id = self.user_id or fakes.user_id + snapshot.project_id = self.project_id or fakes.project_id snapshot.volume_id = volume['id'] snapshot.volume_size = volume['size'] snapshot.host = volume['host']