#NEWLINE# def test_get_user_active_repositories_ok( self ) : #NEWLINE# #INDENT# user = get_user_model ( ) . objects . create_user ( username = 'yop' , password = 'yyy' ) #NEWLINE# r1 = Repository . objects . create ( name = 'user/r1' ) #NEWLINE# r2 = Repository . objects . create ( name = 'user/r2' ) #NEWLINE# Repository . objects . create ( name = 'user/r3' ) #NEWLINE# r1 . users . add ( r2 ) #NEWLINE# r2 . users . add ( user ) #NEWLINE# Webhook . objects . create ( repository = r1 ) #NEWLINE# Webhook . objects . create ( repository = r2 , active = False ) #NEWLINE# self . assertEqual ( list ( views . get_user_active_repositories ( user ) ) , [ r1 ] )