Fix issue with django CMS 3
This commit is contained in:
parent
105171d2ad
commit
99ebd92e38
1 changed files with 5 additions and 4 deletions
|
@ -40,10 +40,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)])
|
||||||
|
@ -52,12 +53,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):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue