From c0c43c04e7021c70cd0d37a7d50b1cb4d687bb9e Mon Sep 17 00:00:00 2001 From: Zbynek Winkler Date: Sun, 12 Jan 2014 18:48:40 +0100 Subject: [PATCH] Failing test for running take_over twice. When user manages to run take_over twice with the same arguments, tak_over creates an orphan. --- tests/test_participant.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_participant.py b/tests/test_participant.py index 040395125f..b2d3fe3ea4 100644 --- a/tests/test_participant.py +++ b/tests/test_participant.py @@ -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):