Pregnant teen obtained pills for illegal abortion, court hears