#NEWLINE# def test_multi( self ) : #NEWLINE# #INDENT# data = [ { #NEWLINE# #INDENT# 'source' : 'test.example.com' , #NEWLINE# 'name' : 'load' , #NEWLINE# 'value' : 0.1 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'source' : 'multi.example.com' , #NEWLINE# 'name' : 'cpu' , #NEWLINE# 'value' : 55.5 , #NEWLINE# #UNINDENT# } ] #NEWLINE# serializer = MetricSerializer ( data = data ) #NEWLINE# self . assertTrue ( serializer . is_valid ( ) ) #NEWLINE# serializer . save ( ) #NEWLINE# for item in data : #NEWLINE# #INDENT# source = models . Source . objects . get ( name = item [ 'source' ] ) #NEWLINE# self . assertEqual ( source . metric_set . count ( ) , 1 )