Skip to content

Commit

Permalink
Improved quota test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Sep 18, 2020
1 parent 798b53b commit e17d4d2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/unit/data/test_quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,18 @@ def test_quota(self):
self._add_group_quota(u, quota)
self._assert_user_quota_is(u, 97)

quota = model.Quota(name="quota quota bigger base", amount=100, operation="=")
quota = model.Quota(name="group quota bigger base", amount=100, operation="=")
self._add_group_quota(u, quota)
self._assert_user_quota_is(u, 127)

quota.deleted = True
self.persist(quota)
self._assert_user_quota_is(u, 97)

quota = model.Quota(name="group quota unlimited", amount=-1, operation="=")
self._add_group_quota(u, quota)
self._assert_user_quota_is(u, None)

def _add_group_quota(self, user, quota):
group = self.model.Group()
uga = self.model.UserGroupAssociation(user, group)
Expand Down

0 comments on commit e17d4d2

Please sign in to comment.