#NEWLINE# @ ensure_empty_collections ( 'users' , 'teams' ) #NEWLINE# @ clear_collections ( 'users' , 'teams' ) #NEWLINE# def test_create_user_request_new_team( self ) : #NEWLINE# #INDENT# '\n        Tests the registration of users creating new teams.\n\n        Covers:\n            partially: user.create_user_request\n            team.get_team_uids\n        ' #NEWLINE# uid = api . user . create_user_request ( new_team_user ) #NEWLINE# assert ( uid == api . user . get_user ( name = new_team_user [ 'username' ] ) [ 'uid' ] ) , 'Good user created unsuccessfully.' #NEWLINE# team = api . team . get_team ( name = new_team_user [ 'team-name-new' ] ) #NEWLINE# assert team , 'Team was not created.' #NEWLINE# team_uids = api . team . get_team_uids ( team [ 'tid' ] ) #NEWLINE# assert ( uid in team_uids ) , 'User was not successfully placed into the new team.' #NEWLINE# sheep_user = new_team_user . copy ( ) #NEWLINE# sheep_user [ 'username' ] = 'something_different' #NEWLINE# with pytest . raises ( WebException ) : #NEWLINE# #INDENT# api . user . create_user_request ( sheep_user ) #NEWLINE# assert False , 'Was able to create a new team... twice' #NEWLINE# #UNINDENT# sheep_user = new_team_user . copy ( ) #NEWLINE# sheep_user [ 'team-name-new' ] = 'noneixstent_team' #NEWLINE# with pytest . raises ( WebException ) : #NEWLINE# #INDENT# api . user . create_user_request ( sheep_user ) #NEWLINE# assert False , 'Was able to create two users with the same username.'