Refactor the quotas tests

Refactoring as part of bug 1157950 to limit the amount of copy-pasting
required when adding a new quota

Change-Id: I32fb28da0d4640c463fb6e22ee04763012d12190