Commit cf86b2d0 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: test: add PinnedDateTime in the mixin

parent abf8a9c3
...@@ -112,6 +112,21 @@ return %s""" % (self.attribute, self.script_name, self.fake_return) ...@@ -112,6 +112,21 @@ return %s""" % (self.attribute, self.script_name, self.fake_return)
transaction.commit() 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): class SlapOSTestCaseMixin(testSlapOSMixin):
expected_html_payzen_redirect_page = None 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