An estimated one in 10 South Africans live in informal settlements
The South African government is being taken to court over plans to abolish shanty towns in the city of Durban.
Community organisations representing Durban shack dwellers say the bill is unconstitutional because it seeks to re-locate residents against their will.
They say many have schooling and work nearby and the move could mean families being separated.
It has been estimated that almost 10% of South Africans still live in such settlements.
They were first set up on the outskirts of major towns and cities during white minority rule.
The shack dwellers' movement, Abahlali baseMjondolo, tried unsuccessfully to get certain provisions of the KwaZulu-Natal Slums Act declared unlawful in a lower court.
'Within the law'
The movement is now bringing its case to the Constitutional Court in Johannesburg.
The campaigners warn that if the act is introduced in KwaZulu-Natal, it will be brought in to other provinces.
It says a few informal settlements have already been demolished in Western Cape province.
The respondents, led by the Department of Land Affairs, are adamant they are acting within the constitution.
Community leader Zweli Nzimande told the BBC's Network Africa programme: "This is not a good act at all. It's taking people far away from where they are staying, to the places where they don't want to go.
"This act is saying people must leave where they used to stay.
"Now they must go 10km (six miles) away from the city, so we are complaining. We are schooling, our parents are working nearby so they can't afford to go somewhere far away."
The BBC's Mpho Lakje in Johannesburg says that when the African National Congress came to power 15 years ago it promised free quality housing for all.
So far the governing party has provided housing for nearly three million people and President Jacob Zuma has promised his new administration will speed up the roll out of state-subsidised housing.