Test training code