A woman who forged paternity test results and lied to her ex-partner about him being the father of her child has been spared prison.