Self-constraint not included in frozen constraints

Not all of 8ed42ceb068d4fe276fd7e323e373b05ba86e113 was cherry-picked.
The test doesn't exist in 1.20 so change to that test were dropped.

(cherry picked from commit 8ed42ceb068d4fe276fd7e323e373b05ba86e113)