Merge branch 'feature/non_required_categories' into feature/fix_parler

This commit is contained in:
Iacopo Spalletti 2016-02-07 13:07:43 +01:00
commit 890c8b7883

View file

@ -41,10 +41,11 @@ class MenuTest(BaseTest):
""" """
posts = self.get_posts() posts = self.get_posts()
pages = self.get_pages() pages = self.get_pages()
self.reload_urlconf()
for lang in ('en', 'it'): for lang in ('en', 'it'):
request = self.get_page_request(pages[1], self.user, pages[1].get_absolute_url(lang))
with smart_override(lang): with smart_override(lang):
request = self.get_page_request(pages[1], self.user, pages[1].get_absolute_url(lang))
nodes = menu_pool.get_nodes(request) nodes = menu_pool.get_nodes(request)
nodes_url = set([node.url for node in nodes]) nodes_url = set([node.url for node in nodes])
cats_url = set([cat.get_absolute_url() for cat in self.cats if cat.has_translation(lang)]) cats_url = set([cat.get_absolute_url() for cat in self.cats if cat.has_translation(lang)])
@ -53,12 +54,12 @@ class MenuTest(BaseTest):
cache.clear() cache.clear()
posts[0].categories.clear() posts[0].categories.clear()
for lang in ('en', 'it'): for lang in ('en', 'it'):
request = self.get_page_request(pages[1], self.user, pages[1].get_absolute_url(lang))
with smart_override(lang): with smart_override(lang):
request = self.get_page_request(pages[1], self.user, pages[1].get_absolute_url(lang))
nodes = menu_pool.get_nodes(request) nodes = menu_pool.get_nodes(request)
nodes_url = set([node.url for node in nodes]) nodes_url = set([node.url for node in nodes])
self.assertFalse(posts[0].get_absolute_url() in nodes_url) self.assertFalse(posts[0].get_absolute_url(lang) in nodes_url)
self.assertTrue(posts[1].get_absolute_url() in nodes_url) self.assertTrue(posts[1].get_absolute_url(lang) in nodes_url)
def test_menu_options(self): def test_menu_options(self):
""" """