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

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Dec 14, 2014
1 parent c0ddb33 commit 53dfbd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gratipay/utils/fake_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def fake_participant(db, number="singular", is_admin=False):
, is_admin=is_admin
, balance=fake_balance()
, anonymous_giving=(random.randrange(5) == 0)
, anonymous_receiving=(random.randrange(5) == 0)
, anonymous_receiving=(number != 'plural' and random.randrange(5) == 0)
, goal=fake_balance()
, balanced_customer_href=faker.uri()
, last_ach_result=''
Expand Down
12 changes: 8 additions & 4 deletions tests/py/test_close.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ def test_cpi_clears_personal_information(self, mailer):
, goal=100
, anonymous_giving=True
, anonymous_receiving=True
, number='plural'
, avatar_url='img-url'
, email_address='[email protected]'
, claimed_time='now'
Expand All @@ -294,7 +293,6 @@ def test_cpi_clears_personal_information(self, mailer):
, receiving=40
, npatrons=21
)
assert Participant.from_username('alice').number == 'plural' # sanity check
alice.add_email('[email protected]')

with self.db.get_cursor() as cursor:
Expand All @@ -303,8 +301,8 @@ def test_cpi_clears_personal_information(self, mailer):

assert alice.statement == new_alice.statement == ''
assert alice.goal == new_alice.goal == None
assert (alice.anonymous_giving, new_alice.anonymous_giving) == (False, False)
assert (alice.anonymous_receiving, new_alice.anonymous_giving) == (False, False)
assert alice.anonymous_giving == new_alice.anonymous_giving == False
assert alice.anonymous_receiving == new_alice.anonymous_receiving == False
assert alice.number == new_alice.number == 'singular'
assert alice.avatar_url == new_alice.avatar_url == None
assert alice.email_address == new_alice.email_address == None
Expand All @@ -317,6 +315,12 @@ def test_cpi_clears_personal_information(self, mailer):
assert alice.session_expires.year == new_alice.session_expires.year == date.today().year
assert not alice.get_emails()

team = self.make_participant('team', number='plural')
with self.db.get_cursor() as cursor:
team.clear_personal_information(cursor)
team2 = Participant.from_username('team')
assert team.number == team2.number == 'singular'

def test_cpi_clears_communities(self):
alice = self.make_participant('alice')
alice.insert_into_communities(True, 'test', 'test')
Expand Down

0 comments on commit 53dfbd1

Please sign in to comment.