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

Commit

Permalink
Failing test for running take_over twice.
Browse files Browse the repository at this point in the history
When user manages to run take_over twice with the same arguments,
tak_over creates an orphan.
  • Loading branch information
zbynekwinkler committed Jan 12, 2014
1 parent fa69ffd commit c0c43c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ def test_do_not_take_over_zero_tips_receiving(self):
assert 2 == ntips
self.db.self_check()

def test_idempotent(self):
alice = TwitterAccount(self.db, 1, dict(screen_name='alice'))
bob = GitHubAccount(self.db, 2, dict(screen_name='bob'))
alice_participant = alice.opt_in('alice')[0].participant
alice_participant.take_over(bob, have_confirmation=True)
alice_participant.take_over(bob, have_confirmation=True)
self.db.self_check()


class TestParticipant(Harness):
def setUp(self):
Expand Down

0 comments on commit c0c43c0

Please sign in to comment.