From edd96b6dc67564e6a7455bde4b054e3fbc11aa79 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sun, 7 May 2017 04:51:51 +0200 Subject: [PATCH] Fix failures in menu tests --- tests/test_menu.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_menu.py b/tests/test_menu.py index 4c11398..cb4ad05 100644 --- a/tests/test_menu.py +++ b/tests/test_menu.py @@ -45,6 +45,7 @@ class MenuTest(BaseTest): for lang in ('en', 'it'): with smart_override(lang): + self._reset_menus() request = self.get_page_request(pages[1], self.user, pages[1].get_absolute_url(lang)) nodes = menu_pool.get_nodes(request) nodes_url = set([node.url for node in nodes]) @@ -55,6 +56,7 @@ class MenuTest(BaseTest): posts[0].categories.clear() for lang in ('en', 'it'): with smart_override(lang): + self._reset_menus() request = self.get_page_request(pages[1], self.user, pages[1].get_absolute_url(lang)) nodes = menu_pool.get_nodes(request) nodes_url = set([node.url for node in nodes]) @@ -75,6 +77,7 @@ class MenuTest(BaseTest): for lang in languages: with smart_override(lang): + self._reset_menus() cats_url[lang] = set([cat.get_absolute_url() for cat in self.cats if cat.has_translation(lang)]) posts_url[lang] = set([post.get_absolute_url(lang) for post in posts if post.has_translation(lang) and post.app_config == self.app_config_1]) @@ -85,6 +88,7 @@ class MenuTest(BaseTest): for lang in languages: request = self.get_page_request(None, self.user, r'/%s/page-two/' % lang) with smart_override(lang): + self._reset_menus() nodes = menu_pool.get_nodes(request) nodes_url = set([node.url for node in nodes]) self.assertFalse(cats_url[lang].issubset(nodes_url)) @@ -97,6 +101,7 @@ class MenuTest(BaseTest): for lang in languages: request = self.get_page_request(None, self.user, r'/%s/page-two/' % lang) with smart_override(lang): + self._reset_menus() nodes = menu_pool.get_nodes(request) nodes_url = set([node.url for node in nodes]) self.assertFalse(cats_url[lang].issubset(nodes_url)) @@ -109,6 +114,7 @@ class MenuTest(BaseTest): for lang in languages: request = self.get_page_request(None, self.user, r'/%s/page-two/' % lang) with smart_override(lang): + self._reset_menus() nodes = menu_pool.get_nodes(request) nodes_url = set([node.url for node in nodes]) self.assertTrue(cats_url[lang].issubset(nodes_url)) @@ -121,6 +127,7 @@ class MenuTest(BaseTest): for lang in languages: request = self.get_page_request(None, self.user, r'/%s/page-two/' % lang) with smart_override(lang): + self._reset_menus() nodes = menu_pool.get_nodes(request) nodes_url = set([node.url for node in nodes]) self.assertTrue(cats_url[lang].issubset(nodes_url))