Laws that made the holding of public office in Britain conditional upon subscribing to the established religion. Although Scotland imposed such a law in 1567, the harsh laws against recusants in England were sufficient in themselves to deter Roman Catholics and dissenters from putting themselves forward for office. But in 1661 membership of town corporations, and in 1673 all offices under the crown, were denied to those who refused to take communion in an Anglican church. In 1678 all Catholics except the Duke of York (the future James II) were excluded from Parliament. In the 18th century religious tests in Scotland were not always enforced, except for university posts, and in England the test could be met by occasional communion, but this was not possible for Roman Catholics. The Test Acts were finally repealed in 1829, and university religious tests were abolished in the 1870s and 1880s.