Commit 647244c1 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: test: add PinnedDateTime in the mixin

parent 9b011644
......@@ -112,6 +112,21 @@ return %s""" % (self.attribute, self.script_name, self.fake_return)
transaction.commit()
class PinnedDateTime(object):
"""
Context manager for changing the zope date
"""
def __init__(self, testinstance, datetime):
self.datetime = datetime
self.testinstance = testinstance
def __enter__(self):
self.testinstance.pinDateTime(self.datetime)
def __exit__(self, *args, **kw):
self.testinstance.unpinDateTime()
class SlapOSTestCaseMixin(testSlapOSMixin):
expected_html_payzen_redirect_page = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment