示例#1
0
def test_feedgetters():
    this, *other = (Record.new() for _ in range(3))
    for x in other:
        relations.follow(x, this)

    it = relations.feedgetters(this)
    assert sum(1 for _ in it) == len(other)
示例#2
0
def test_followers_and_friends():
    this, other = (Record.new() for _ in range(2))

    relations.follow(other, this)
    assert relations.is_follower(other, this)
    assert not relations.are_friends(other, this)

    relations.follow(this, other)
    assert relations.is_follower(this, other)
    assert relations.are_friends(other, this)

    relations.unfollow(this, other)
    assert not relations.is_follower(this, other)
    assert not relations.are_friends(other, this)