when to take a test

So I miscarried around February 11. I stopped bleeding on February 17. We've had plenty of sex. I haven't been <a href="https://play.google.com/store/apps/details?id=com.glow.android">tracking ovulation</a>. But I've had a lot of discharge & some brown spotting. I only spotted for 2 days and it was only when I wiped. My question is when should I take a pregnancy test?