def test_it_should_remove_the_pending_relationship_if_you_block_someone( self): amico = Amico( options={ 'pending_follow': True}, redis_connection=self.redis_connection) amico.follow(11, 1) amico.is_pending(11, 1).should.be.true amico.is_pending_with(1, 11).should.be.true amico.block(1, 11) amico.is_pending(11, 1).should.be.false amico.is_pending_with(1, 11).should.be.false amico.is_blocked(1, 11).should.be.true
def test_it_should_remove_the_pending_relationship_without_following_or_blocking( self): amico = Amico( options={ 'pending_follow': True}, redis_connection=self.redis_connection) amico.follow(1, 11) amico.is_pending(1, 11).should.be.true amico.is_pending_with(11, 1).should.be.true amico.deny(1, 11) amico.is_following(1, 11).should.be.false amico.is_pending(1, 11).should.be.false amico.is_pending_with(11, 1).should.be.false amico.is_blocked(1, 11).should.be.false
def test_it_should_remove_the_pending_relationship_and_add_to_following_and_followers_if_accept_is_called( self): amico = Amico( options={ 'pending_follow': True}, redis_connection=self.redis_connection) amico.follow(1, 11) amico.is_pending(1, 11).should.be.true amico.is_pending_with(11, 1).should.be.true amico.accept(1, 11) amico.is_pending(1, 11).should.be.false amico.is_pending_with(11, 1).should.be.false amico.is_following(1, 11).should.be.true amico.is_following(11, 1).should.be.false amico.is_follower(11, 1).should.be.true amico.is_follower(1, 11).should.be.false