Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Merge branch 'master' into tinker-with-timing
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbk authored Jan 12, 2017
2 parents fcb3ac2 + 8d10188 commit dd319f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gratipay/models/participant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ class BalanceIsNotZero(Exception): pass
def final_check(self, cursor):
"""Sanity-check that teams and balance have been dealt with.
"""
if self.get_teams(cursor=cursor):
if self.get_teams(cursor=cursor, only_open=True):
raise self.StillOnATeam
if self.balance != 0:
raise self.BalanceIsNotZero
Expand Down
6 changes: 6 additions & 0 deletions tests/py/test_close.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def test_close_fails_if_still_owns_a_team(self):
with pytest.raises(alice.StillOnATeam):
alice.close()

def test_close_succeeds_if_team_is_closed(self):
alice = self.make_participant('alice', claimed_time='now')
self.make_team(owner=alice, is_closed=True)
alice.close()
assert P('alice').is_closed

def test_close_page_is_usually_available(self):
self.make_participant('alice', claimed_time='now')
body = self.client.GET('/~alice/settings/close', auth_as='alice').body
Expand Down

0 comments on commit dd319f6

Please sign in to comment.