Ejemplo n.º 1
0
    def test_it_should_remove_the_pending_relationship_and_add_to_following_and_followers_if_accept_is_called_and_add_to_reciprocated_relationship(
            self):
        amico = Amico(
            options={
                'pending_follow': True},
            redis_connection=self.redis_connection)
        amico.follow(1, 11)
        amico.follow(11, 1)
        amico.is_pending(1, 11).should.be.true
        amico.is_pending(11, 1).should.be.true

        amico.accept(1, 11)

        amico.is_pending(1, 11).should.be.false
        amico.is_pending(11, 1).should.be.true
        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

        amico.accept(11, 1)

        amico.is_pending(1, 11).should.be.false
        amico.is_pending(11, 1).should.be.false
        amico.is_following(1, 11).should.be.true
        amico.is_following(11, 1).should.be.true
        amico.is_follower(11, 1).should.be.true
        amico.is_follower(1, 11).should.be.true
        amico.is_reciprocated(1, 11).should.be.true
Ejemplo n.º 2
0
    def test_it_should_return_that_you_are_following(self):
        amico = Amico(redis_connection=self.redis_connection)
        amico.follow(1, 11)
        amico.is_following(1, 11).should.be.true
        amico.is_following(11, 1).should.be.false

        amico.follow(11, 1)
        amico.is_following(11, 1).should.be.true
Ejemplo n.º 3
0
    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
Ejemplo n.º 4
0
 def test_it_should_return_that_someone_is_being_blocked(self):
     amico = Amico(redis_connection=self.redis_connection)
     amico.block(1, 11)
     amico.is_blocked(1, 11).should.be.true
     amico.is_following(11, 1).should.be.false