Fix the gc test.
This commit is contained in:
parent
990739b1e5
commit
740bc31058
1 changed files with 9 additions and 4 deletions
|
@ -10,17 +10,22 @@ PUBLIC_USER = 'public'
|
||||||
REPO = 'somerepo'
|
REPO = 'somerepo'
|
||||||
|
|
||||||
class TestGarbageColection(unittest.TestCase):
|
class TestGarbageColection(unittest.TestCase):
|
||||||
def setUp(self):
|
@staticmethod
|
||||||
self._old_tm_expiration = app.config['TIME_MACHINE_DELTA_SECONDS']
|
def _set_tag_expiration_policy(namespace, expiration_s):
|
||||||
app.config['TIME_MACHINE_DELTA_SECONDS'] = 0
|
namespace_user = model.get_user(namespace)
|
||||||
|
model.change_user_tag_expiration(namespace_user, expiration_s)
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
setup_database_for_testing(self)
|
setup_database_for_testing(self)
|
||||||
|
|
||||||
|
self._set_tag_expiration_policy(ADMIN_ACCESS_USER, 0)
|
||||||
|
self._set_tag_expiration_policy(PUBLIC_USER, 0)
|
||||||
|
|
||||||
self.app = app.test_client()
|
self.app = app.test_client()
|
||||||
self.ctx = app.test_request_context()
|
self.ctx = app.test_request_context()
|
||||||
self.ctx.__enter__()
|
self.ctx.__enter__()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
app.config['TIME_MACHINE_DELTA_SECONDS'] = self._old_tm_expiration
|
|
||||||
finished_database_for_testing(self)
|
finished_database_for_testing(self)
|
||||||
self.ctx.__exit__(True, None, None)
|
self.ctx.__exit__(True, None, None)
|
||||||
|
|
||||||
|
|
Reference in a new issue