changeset 5708:2cc8d876d1c8

tests: summary: fix inter-test dependency Test test_index_trending depended on previous actions performed by the test test_index_statistics. Such inter-test dependencies should not be present. This would become a problem when converting the test class to pytest-style, because the app is recreated for each test, while the original TestController creates it once per class.
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Thu, 11 Feb 2016 12:13:50 +0100
parents 37d713674f63
children 877bcf22bf71
files kallithea/tests/functional/test_summary.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/tests/functional/test_summary.py	Tue Feb 09 17:51:09 2016 +0100
+++ b/kallithea/tests/functional/test_summary.py	Thu Feb 11 12:13:50 2016 +0100
@@ -121,6 +121,9 @@
         self._enable_stats(HG_REPO)
 
         ScmModel().mark_for_invalidation(HG_REPO)
+        # generate statistics first
+        response = self.app.get(url(controller='summary', action='statistics',
+                                    repo_name=HG_REPO))
         response = self.app.get(url(controller='summary', action='index',
                                     repo_name=HG_REPO))
         response.mustcontain(
@@ -151,6 +154,9 @@
         self._enable_stats(GIT_REPO)
 
         ScmModel().mark_for_invalidation(GIT_REPO)
+        # generate statistics first
+        response = self.app.get(url(controller='summary', action='statistics',
+                                    repo_name=GIT_REPO))
         response = self.app.get(url(controller='summary', action='index',
                                     repo_name=GIT_REPO))
         response.mustcontain(