#NEWLINE# @ mock . patch ( 'h.accounts.models.User.get_by_username' ) #NEWLINE# def test_make_admin_sets_admin_to_True_if_False( get_by_username ) : #NEWLINE# #INDENT# 'It should set .admin to True if it was False.' #NEWLINE# fred = mock . Mock ( ) #NEWLINE# fred . admin = False #NEWLINE# get_by_username . return_value = fred #NEWLINE# accounts . make_admin ( 'fred' ) #NEWLINE# assert ( fred . admin is True )