Wherever you got that from has it backwards (it's a myth commonly repeated). The fruit name came first:
> In Molina's Nahuatl dictionary "auacatl" is given also as the translation for compañón "testicle", and this has been taken up in popular culture where a frequent claim is that testicle was the word's original meaning. This is not the case, as the original meaning can be reconstructed as "avocado" – rather the word seems to have been used in Nahuatl as a euphemism for "testicle".