The Unionist Party ( , UP ) was a pre-apartheid South African political party , which contested elections to the Union of South Africa parliament from the 1910 South African general election until its merger into the South African Party just before the 1921 South African general election .