def test_exclude_private_books(self):
        """
        Must generate query sets or lists with Books depending on user type.
        """
        all_books = Book.objects.all()
        list_all_books = list(all_books)

        self.assertEqual(Book.exclude_private_books(self.the_user1.id_user, all_books).count(), 7)
        self.assertEqual(Book.exclude_private_books(self.the_user2.id_user, all_books).count(), 5)
        self.assertTrue(isinstance(Book.exclude_private_books(self.the_user1.id_user, all_books), QuerySet))
        self.assertTrue(isinstance(Book.exclude_private_books(self.the_user2.id_user, all_books), QuerySet))

        self.assertEqual(len(Book.exclude_private_books(self.the_user1.id_user, list_all_books)), 7)
        self.assertEqual(len(Book.exclude_private_books(self.the_user2.id_user, list_all_books)), 5)
        self.assertTrue(isinstance(Book.exclude_private_books(self.the_user1.id_user, list_all_books), list))
        self.assertTrue(isinstance(Book.exclude_private_books(self.the_user2.id_user, list_all_books), list))

        self.assertTrue(self.anonymous_user.is_anonymous)
        self.assertEqual(Book.exclude_private_books(self.anonymous_user, all_books).count(), 5)
        self.assertEqual(len(Book.exclude_private_books(self.anonymous_user, list_all_books)), 5)
        self.assertTrue(isinstance(Book.exclude_private_books(self.anonymous_user, all_books), QuerySet))
        self.assertTrue(isinstance(Book.exclude_private_books(self.anonymous_user, list_all_books), list))