#NEWLINE# def test_nested_route_depth_3( self ) : #NEWLINE# #INDENT# router = ExtendedSimpleRouter ( ) #NEWLINE# router . register ( 'users' , UserViewSet , 'user' ) . register ( 'groups' , GroupViewSet , 'users-group' , parents_query_lookups = [ 'user' ] ) . register ( 'permissions' , PermissionViewSet , 'users-groups-permission' , parents_query_lookups = [ 'group__user' , 'group' ] ) #NEWLINE# self . assertEqual ( router . urls [ 0 ] . name , 'user-list' ) #NEWLINE# self . assertEqual ( router . urls [ 0 ] . _regex , '^users/$' ) #NEWLINE# self . assertEqual ( router . urls [ 1 ] . name , 'user-detail' ) #NEWLINE# self . assertEqual ( router . urls [ 1 ] . _regex , '^users/{0}/$' . format ( self . get_lookup_regex ( 'pk' ) ) ) #NEWLINE# self . assertEqual ( router . urls [ 2 ] . name , 'users-group-list' ) #NEWLINE# self . assertEqual ( router . urls [ 2 ] . _regex , '^users/{0}/groups/$' . format ( self . get_parent_lookup_regex ( 'user' ) ) ) #NEWLINE# self . assertEqual ( router . urls [ 3 ] . name , 'users-group-detail' ) #NEWLINE# self . assertEqual ( router . urls [ 3 ] . _regex , '^users/{0}/groups/{1}/$' . format ( self . get_parent_lookup_regex ( 'user' ) , self . get_lookup_regex ( 'pk' ) ) ) #NEWLINE# self . assertEqual ( router . urls [ 4 ] . name , 'users-groups-permission-list' ) #NEWLINE# self . assertEqual ( router . urls [ 4 ] . _regex , '^users/{0}/groups/{1}/permissions/$' . format ( self . get_parent_lookup_regex ( 'group__user' ) , self . get_parent_lookup_regex ( 'group' ) ) ) #NEWLINE# self . assertEqual ( router . urls [ 5 ] . name , 'users-groups-permission-detail' ) #NEWLINE# self . assertEqual ( router . urls [ 5 ] . _regex , '^users/{0}/groups/{1}/permissions/{2}/$' . format ( self . get_parent_lookup_regex ( 'group__user' ) , self . get_parent_lookup_regex ( 'group' ) , self . get_lookup_regex ( 'pk' ) ) )