@@ -881,6 +881,36 @@ def test_not_in_navigation_num_queries(self):
881
881
tpl = Template ("{% load menu_tags %}{% show_menu_below_id 'a' 0 100 100 100 %}" )
882
882
tpl .render (context )
883
883
884
+ def test_menu_in_soft_root (self ):
885
+ """
886
+ Test for issue 3504
887
+
888
+ Build the following tree:
889
+
890
+ A
891
+ |-B
892
+ C (soft_root)
893
+ """
894
+ a = create_page ('A' , 'nav_playground.html' , 'en' , published = True ,
895
+ in_navigation = True , reverse_id = 'a' )
896
+ b = create_page ('B' , 'nav_playground.html' , 'en' , parent = a ,
897
+ published = True , in_navigation = True )
898
+ c = create_page ('C' , 'nav_playground.html' , 'en' , published = True ,
899
+ in_navigation = True , soft_root = True )
900
+ context = self .get_context (a .get_absolute_url ())
901
+ tpl = Template ("{% load menu_tags %}{% show_menu_below_id 'a' %}" )
902
+ tpl .render (context )
903
+ nodes = context ['children' ]
904
+ self .assertEqual (len (nodes ), 1 )
905
+ node = nodes [0 ]
906
+ self .assertEqual (node .id , b .publisher_public .id )
907
+ context = self .get_context (c .get_absolute_url ())
908
+ tpl = Template ("{% load menu_tags %}{% show_menu_below_id 'a' %}" )
909
+ tpl .render (context )
910
+ nodes = context ['children' ]
911
+ self .assertEqual (len (nodes ), 1 )
912
+ node = nodes [0 ]
913
+ self .assertEqual (node .id , b .publisher_public .id )
884
914
885
915
class ViewPermissionMenuTests (SettingsOverrideTestCase ):
886
916
settings_overrides = {
0 commit comments