#NEWLINE# def test_serializer_facet_narrow( self ) : #NEWLINE# #INDENT# response = self . client . get ( path = '/search-person/facets/' , data = QueryDict ( 'selected_facets=firstname_exact:John&selected_facets=lastname_exact:McClane' ) , format = 'json' ) #NEWLINE# self . assertEqual ( response . data [ 'queries' ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( [ all ( ( 'firstname' , ( 'lastname' in response . data [ 'fields' ] ) ) ) ] ) #NEWLINE# self . assertEqual ( len ( response . data [ 'fields' ] [ 'firstname' ] ) , 1 ) #NEWLINE# self . assertEqual ( response . data [ 'fields' ] [ 'firstname' ] [ 0 ] [ 'text' ] , 'John' ) #NEWLINE# self . assertEqual ( response . data [ 'fields' ] [ 'firstname' ] [ 0 ] [ 'count' ] , 1 ) #NEWLINE# self . assertEqual ( response . data [ 'fields' ] [ 'firstname' ] [ 0 ] [ 'narrow_url' ] , '/search-person/facets/?selected_facets=firstname_exact%3AJohn&selected_facets=lastname_exact%3AMcClane' ) #NEWLINE# self . assertEqual ( len ( response . data [ 'fields' ] [ 'lastname' ] ) , 1 ) #NEWLINE# self . assertEqual ( response . data [ 'fields' ] [ 'lastname' ] [ 0 ] [ 'text' ] , 'McClane' ) #NEWLINE# self . assertEqual ( response . data [ 'fields' ] [ 'lastname' ] [ 0 ] [ 'count' ] , 1 ) #NEWLINE# self . assertEqual ( response . data [ 'fields' ] [ 'lastname' ] [ 0 ] [ 'narrow_url' ] , '/search-person/facets/?selected_facets=firstname_exact%3AJohn&selected_facets=lastname_exact%3AMcClane' ) #NEWLINE# self . assertTrue ( ( 'created' in response . data [ 'dates' ] ) ) #NEWLINE# self . assertEqual ( len ( response . data [ 'dates' ] ) , 1 ) #NEWLINE# self . assertEqual ( response . data [ 'dates' ] [ 'created' ] [ 0 ] [ 'text' ] , '2015-05-01T00:00:00' ) #NEWLINE# self . assertEqual ( response . data [ 'dates' ] [ 'created' ] [ 0 ] [ 'count' ] , 1 ) #NEWLINE# self . assertEqual ( response . data [ 'dates' ] [ 'created' ] [ 0 ] [ 'narrow_url' ] , '/search-person/facets/?selected_facets=created_exact%3A2015-05-01+00%3A00%3A00&selected_facets=firstname_exact%3AJohn&selected_facets=lastname_exact%3AMcClane' )