#NEWLINE# def test_categories_is_a_str( self ) : #NEWLINE# #INDENT# series_input = { #NEWLINE# #INDENT# 'avg_price' : { #NEWLINE# #INDENT# 'source' : SalesHistory . objects . all ( ) , #NEWLINE# 'func' : Avg ( 'price' ) , #NEWLINE# 'categories' : 'bookstore__city__state' , #NEWLINE# 'legend_by' : [ 'book__genre__name' ] , #NEWLINE# 'top_n_per_cat' : 5 , #NEWLINE# 'field_aliases' : { #NEWLINE# #INDENT# 'bookstore__city__state' : 'state' , #NEWLINE# 'book__genre__name' : 'name' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# series_cleaned = { #NEWLINE# #INDENT# 'avg_price' : { #NEWLINE# #INDENT# 'source' : SalesHistory . objects . all ( ) , #NEWLINE# 'func' : Avg ( 'price' ) , #NEWLINE# 'categories' : [ 'bookstore__city__state' ] , #NEWLINE# 'legend_by' : [ 'book__genre__name' ] , #NEWLINE# 'top_n_per_cat' : 5 , #NEWLINE# 'field_aliases' : { #NEWLINE# #INDENT# 'bookstore__city__state' : 'state' , #NEWLINE# 'book__genre__name' : 'name' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertOptionDictsEqual ( clean_pdps ( series_input ) , series_input )