# HG changeset patch # User Mads Kiilerich # Date 2016-03-14 16:17:46 # Node ID 5cb780fd494d13bc296d15fc63b35f6af12b6698 # Parent b76cdfccb5b8ad3903817c603c30c31468851044 tests: invalidate cache for new repositories - make tests more stable if garbage has been left behind in the db It could be argued that this should be done elsewhere in the app ... diff --git a/kallithea/tests/fixture.py b/kallithea/tests/fixture.py --- a/kallithea/tests/fixture.py +++ b/kallithea/tests/fixture.py @@ -147,6 +147,7 @@ class Fixture(object): cur_user = kwargs.get('cur_user', TEST_USER_ADMIN_LOGIN) RepoModel().create(form_data, cur_user) Session().commit() + ScmModel().mark_for_invalidation(name) return Repository.get_by_repo_name(name) def create_fork(self, repo_to_fork, fork_name, **kwargs): @@ -166,6 +167,7 @@ class Fixture(object): owner = kwargs.get('cur_user', TEST_USER_ADMIN_LOGIN) RepoModel().create_fork(form_data, cur_user=owner) Session().commit() + ScmModel().mark_for_invalidation(fork_name) r = Repository.get_by_repo_name(fork_name) assert r return r