#NEWLINE# def test_create_data_center_with_tags( self ) : #NEWLINE# #INDENT# url = reverse ( 'datacenterasset-list' ) #NEWLINE# data = { #NEWLINE# #INDENT# 'hostname' : '12345' , #NEWLINE# 'model' : self . model . id , #NEWLINE# 'rack' : self . rack . id , #NEWLINE# 'service_env' : self . service_env . id , #NEWLINE# 'force_depreciation' : False , #NEWLINE# 'tags' : [ 'prod' , 'db' ] , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( url , data , format = 'json' ) #NEWLINE# self . assertEqual ( response . status_code , status . HTTP_201_CREATED ) #NEWLINE# dc_asset = DataCenterAsset . objects . get ( pk = response . data [ 'id' ] ) #NEWLINE# self . assertEqual ( dc_asset . hostname , '12345' ) #NEWLINE# self . assertEqual ( dc_asset . service_env , self . service_env ) #NEWLINE# self . assertEqual ( dc_asset . rack , self . rack ) #NEWLINE# self . assertEqual ( dc_asset . tags . count ( ) , 2 )