@@ -14,7 +14,9 @@ def setUp(self):
14
14
MenuItem ("kids2-2" , "/kids2-2" )
15
15
]
16
16
kids3 = [
17
- MenuItem ("kids3-1" , "/parent3/kids3-1" )
17
+ MenuItem ("kids3-1" , "/parent3/kids3-1" , children = [
18
+ MenuItem ("kids3-1-1" , "/parent3/kids3-1/kid1" )
19
+ ])
18
20
]
19
21
20
22
Menu .items = {}
@@ -49,6 +51,15 @@ def test_select_parents(self):
49
51
self .assertEqual (Menu .items ['test' ][2 ].selected , False )
50
52
self .assertEqual (Menu .items ['test' ][1 ].children [1 ].selected , True )
51
53
54
+ settings .MENU_SELECT_PARENTS = True
55
+ request = self .factory .get ('/parent3/kids3-1/kid1' )
56
+ Menu .process (request , 'test' )
57
+ self .assertEqual (Menu .items ['test' ][0 ].selected , False )
58
+ self .assertEqual (Menu .items ['test' ][1 ].selected , False )
59
+ self .assertEqual (Menu .items ['test' ][1 ].children [1 ].selected , False )
60
+ self .assertEqual (Menu .items ['test' ][2 ].selected , True )
61
+ self .assertEqual (Menu .items ['test' ][2 ].children [0 ].selected , True )
62
+ self .assertEqual (Menu .items ['test' ][2 ].children [0 ].children [0 ].selected , True )
52
63
53
64
def test_template_tag (self ):
54
65
"""
0 commit comments