diff --git a/test/test_gc.py b/test/test_gc.py index 27c44c61c..02d14bfb4 100644 --- a/test/test_gc.py +++ b/test/test_gc.py @@ -10,17 +10,22 @@ PUBLIC_USER = 'public' REPO = 'somerepo' class TestGarbageColection(unittest.TestCase): - def setUp(self): - self._old_tm_expiration = app.config['TIME_MACHINE_DELTA_SECONDS'] - app.config['TIME_MACHINE_DELTA_SECONDS'] = 0 + @staticmethod + def _set_tag_expiration_policy(namespace, expiration_s): + namespace_user = model.get_user(namespace) + model.change_user_tag_expiration(namespace_user, expiration_s) + def setUp(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.ctx = app.test_request_context() self.ctx.__enter__() def tearDown(self): - app.config['TIME_MACHINE_DELTA_SECONDS'] = self._old_tm_expiration finished_database_for_testing(self) self.ctx.__exit__(True, None, None)