Getting Tested?

M

If I’m ready to have sex, and my partner and I are both virgins, should I get tested before or after having sex? Or both?