#NEWLINE# @ mock . patch ( 'easy_select2.utils.Select2Multiple' ) #NEWLINE# @ mock . patch ( 'easy_select2.utils.Select2' ) #NEWLINE# def test_select2_modelform_meta_with_attrs_argument( Select2Mock , Select2MultipleMock ) : #NEWLINE# #INDENT# attrs = { #NEWLINE# #INDENT# 'attribute' : True , #NEWLINE# #UNINDENT# } #NEWLINE# utils . select2_modelform_meta ( m . TestFieldsModel , attrs = attrs ) #NEWLINE# Select2Mock . assert_called_with ( select2attrs = attrs ) #NEWLINE# assert ( Select2Mock . call_count == 2 ) #NEWLINE# Select2MultipleMock . assert_called_with ( select2attrs = attrs ) #NEWLINE# assert ( attrs . call_count == 1 )