Fix DB unit tests in the western hemisphere
The commit 77a36ec519
changed
purge_deleted to (correctly) calculate the age of stacks using UTC
rather than local time, but the unit tests were not modified accordingly
with the result that they failed when run in time zones with substantial
negative offsets from UTC.
Change-Id: Ibc0583c17c36dc16c6809e12d326360cb15cd215
This commit is contained in:
parent
d20a75b2fc
commit
d906feca28
|
@ -1862,7 +1862,7 @@ class DBAPIStackTest(common.HeatTestCase):
|
|||
db_api.stack_count_all(self.ctx, tenant_safe=False))
|
||||
|
||||
def test_purge_deleted(self):
|
||||
now = datetime.datetime.now()
|
||||
now = datetime.datetime.utcnow()
|
||||
delta = datetime.timedelta(seconds=3600 * 7)
|
||||
deleted = [now - delta * i for i in range(1, 6)]
|
||||
templates = [create_raw_template(self.ctx) for i in range(5)]
|
||||
|
@ -1887,7 +1887,7 @@ class DBAPIStackTest(common.HeatTestCase):
|
|||
(), (0, 1, 2, 3, 4))
|
||||
|
||||
def test_purge_deleted_prev_raw_template(self):
|
||||
now = datetime.datetime.now()
|
||||
now = datetime.datetime.utcnow()
|
||||
templates = [create_raw_template(self.ctx) for i in range(2)]
|
||||
stacks = [create_stack(self.ctx, templates[0],
|
||||
create_user_creds(self.ctx),
|
||||
|
|
Loading…
Reference in New Issue