#NEWLINE# def test_get_repositories_with_username( self ) : #NEWLINE# #INDENT# 'Testing the GET repositories/?username= API' #NEWLINE# hosting_account = HostingServiceAccount . objects . create ( service_name = 'github' , username = 'my-username' ) #NEWLINE# Repository . objects . create ( name = 'My New Repository 1' , path = 'https://example.com' , tool = Tool . objects . get ( name = 'Git' ) , hosting_account = hosting_account ) #NEWLINE# Repository . objects . create ( name = 'My New Repository 2' , path = 'https://example.com' , username = 'my-username' , tool = Tool . objects . get ( name = 'Subversion' ) ) #NEWLINE# rsp = self . api_get ( ( get_repository_list_url ( ) + '?username=my-username' ) , expected_mimetype = repository_list_mimetype ) #NEWLINE# self . assertEqual ( rsp [ 'stat' ] , 'ok' ) #NEWLINE# self . assertEqual ( len ( rsp [ 'repositories' ] ) , 2 ) #NEWLINE# self . assertEqual ( rsp [ 'repositories' ] [ 0 ] [ 'name' ] , 'My New Repository 1' ) #NEWLINE# self . assertEqual ( rsp [ 'repositories' ] [ 1 ] [ 'name' ] , 'My New Repository 2' )