#NEWLINE# def test_save( self ) : #NEWLINE# #INDENT# user = UserFactory ( ) #NEWLINE# team = TeamFactory ( ) #NEWLINE# data = { #NEWLINE# #INDENT# 'user' : user . pk , #NEWLINE# 'role' : 'owner' , #NEWLINE# #UNINDENT# } #NEWLINE# form = forms . TeamMemberAddForm ( data = data , team = self ) #NEWLINE# assert form . is_valid ( ) #NEWLINE# form . save ( ) #NEWLINE# assert ( team . users . count ( ) == 1 ) #NEWLINE# member = team . members . first ( ) #NEWLINE# assert ( member . user == user ) #NEWLINE# assert ( member . role == 'owner' )