#NEWLINE# def test_related_site_network_vlan( self ) : #NEWLINE# #INDENT# n = self . s1 . network_set . all ( ) [ 0 ] #NEWLINE# state = { #NEWLINE# #INDENT# 'networks' : [ n . pk ] , #NEWLINE# 'sites' : [ self . s1 . pk ] , #NEWLINE# 'vlans' : [ n . vlan . pk ] , #NEWLINE# #UNINDENT# } #NEWLINE# state [ 'choice' ] = [ 'site' , self . s1 . pk ] #NEWLINE# resp = self . client . post ( ( '/en-US' + reverse ( 'find-related' ) ) , json . dumps ( state ) , content_type = 'application/json' ) #NEWLINE# self . assertEqual ( 200 , resp . status_code ) #NEWLINE# r = json . loads ( resp . content ) #NEWLINE# self . assertEqual ( 1 , len ( r [ 'networks' ] ) ) #NEWLINE# self . assertEqual ( n . pk , r [ 'networks' ] [ 0 ] [ 'value' ] ) #NEWLINE# self . assertEqual ( 1 , len ( r [ 'sites' ] ) ) #NEWLINE# self . assertEqual ( self . s1 . pk , r [ 'sites' ] [ 0 ] [ 'value' ] ) #NEWLINE# self . assertEqual ( 1 , len ( resp [ 'vlans' ] ) ) #NEWLINE# self . assertEqual ( n . vlan . pk , r [ 'vlans' ] [ 0 ] [ 'value' ] )