#NEWLINE# def test_api_region_validate_error( self ) : #NEWLINE# #INDENT# url = reverse ( 'baseobjectlicence-list' ) #NEWLINE# data = { #NEWLINE# #INDENT# 'base_object' : self . base_object . id , #NEWLINE# 'licence' : self . licence1 . id , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( url , data = data , format = 'json' ) #NEWLINE# self . assertEqual ( response . status_code , status . HTTP_400_BAD_REQUEST ) #NEWLINE# self . assertEqual ( response . data [ 'non_field_errors' ] , [ 'Asset region is in a different region than licence.' ] )