def test_FriendServerViewAcess_false_not_friend_same_server(self): author1 = Author(host="https://newpee.herokuapp.com/") author2 = Author(host="https://newpee.herokuapp.com/") author1.save() author2.save() test_post = Post(author=author1) test_post.save() self.assertFalse(test_post.FriendServerViewAcess(author2))
def test_FriendServerViewAcess_true(self): author1 = Author(host="https://newpee.herokuapp.com/") author2 = Author(host="https://newpee.herokuapp.com/") author1.save() author2.save() author1.friends.add(author2) author2.friends.add(author1) test_post = Post(author=author1) test_post.save() self.assertTrue(test_post.FriendServerViewAcess(author2))