#NEWLINE# def test_create_duplicate_device( self ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'key' : 'KEY1' , #NEWLINE# 'type' : 'android' , #NEWLINE# #UNINDENT# } #NEWLINE# self . create_device ( response ) #NEWLINE# response = self . create_device ( data ) #NEWLINE# self . assertEqual ( response . status_code , status . HTTP_400_BAD_REQUEST ) #NEWLINE# self . assertEqual ( response . data [ 'non_field_errors' ] [ 0 ] , 'The fields key, type must make a unique set.' )