A 21-year-old woman will give birth in jail as part of her punishment for a violent, racially motivated attack on a young Afghan asylum seeker in Tasmania.

Theresa Maree Hillier took offence to her 15-year-old victim speaking Farsi on a public bus in Hobart.

However, the Magistrates Court heard that teenager had been in the state less than three months and knew no English.

He had to fled to Australia seeking safety after his family in Afghanistan was targeted by the Taliban.

During the attack, Hillier swore at the teenager and hit him about the head.

Her boyfriend and co-accused, Raymond Michael Horton, allegedly joined in, repeatedly punching and kneeing the boy about the head and body.

Magistrate Sam Mollard said the attack was racially motivated.

"This was a racial attack - there's no other explanation or possibility and none has been offered," he said.

The Magistrate said Hillier's jail sentence would be particularly tough because she was pregnant and would have to give birth behind bars.

"It's an appalling reality, a disgrace to her and a stigma on the next generation... it's a step I take with misgivings," he said.

Raymond Michael Horton, Hiller's boyfriend, allegedly joined his girlfriend in attacking the refugee. ( ABC News )

However, Mr Mollard said, the harm done to the boy wasn't just physical - it was psychological.

Dr Gillian Long, the acting chief executive of the Migrant Resource Centre, agreed, saying that many refugees did not report attacks out of fear.

"This does send the message that people should come forward, that the police do respond and that our justice system will respond to racists attacks," she said.

"They've witnessed torture, experienced trauma and then to go through further trauma when they arrive here which is supposed to be a safe country is just devastating."