#NEWLINE# def test_cache_tree_children_caches_parents( self ) : #NEWLINE# #INDENT# "\n        Ensures that each node's parent is cached by ``cache_tree_children``.\n        " #NEWLINE# with self . assertNumQueries ( 1 ) : #NEWLINE# #INDENT# roots = cache_tree_children ( Category . objects . all ( ) ) #NEWLINE# games = roots [ 0 ] #NEWLINE# wii = games . get_children ( ) [ 0 ] #NEWLINE# wii_games = wii . get_children ( ) [ 0 ] #NEWLINE# self . assertEqual ( wii , wii_games . parent ) #NEWLINE# self . assertEqual ( games , wii_games . parent . parent )