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
This commit is contained in:
Tom Barron 2016-03-09 11:12:17 -05:00
parent 0a2384f320
commit 41e4a9b771
1 changed files with 5 additions and 4 deletions

View File

@ -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']