'top: in navigation
tag: show_menu 0 100 0 100
context shared: current page is aaa
context 1: root is NOT a softroot
context 2: root IS a softroot
expected result 1:
0:top
1:root
2:aaa
3:111
4:ccc
5:ddd
3:222
2:bbb
expected result 2:
0:root
1:aaa
2:111
3:ccc
4:ddd
2:222
1:bbb'

def test_top_in_nav(self):

    aaa = self.get_page('aaa')
    context = self.get_context(aaa.get_absolute_url(), page=aaa)
    tpl = Template('{%    load    menu_tags    %}{%    show_menu    0    100    0    100    %}')
    tpl.render(context)
    hard_root = context['children']
    mock_tree = [AttributeObject(title='top', level=0, children=[AttributeObject(title='root', level=1, children=[AttributeObject(title='aaa', level=2, children=[AttributeObject(title='111', level=3, children=[AttributeObject(title='ccc', level=4, children=[AttributeObject(title='ddd', level=5, children=[])])]), AttributeObject(title='222', level=3, children=[])]), AttributeObject(title='bbb', level=2, children=[])])])]
    self.assertTreeQuality(hard_root, mock_tree)
    root = self.get_page('root')
    root.soft_root = True
    root.save()
    aaa = self.get_page('aaa')
    context = self.get_context(aaa.get_absolute_url(), page=aaa)
    tpl = Template('{%    load    menu_tags    %}{%    show_menu    0    100    0    100    %}')
    tpl.render(context)
    soft_root = context['children']
    mock_tree = [AttributeObject(title='root', level=0, children=[AttributeObject(title='aaa', level=1, children=[AttributeObject(title='111', level=2, children=[AttributeObject(title='ccc', level=3, children=[AttributeObject(title='ddd', level=4, children=[])])]), AttributeObject(title='222', level=2, children=[])]), AttributeObject(title='bbb', level=1, children=[])])]
    self.assertTreeQuality(soft_root, mock_tree, 'title', 'level')
