From the study I read it stated that testosterone levels were higher in the summer, but it never mentioned anything about sun exposure.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5057046/table/T0001/?report=objectonly
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5057046/table/T0001/?report=objectonly