def test_sort_by_book_name_category2(self):
        """
        Must generate correct dictionaries for anonymous users, users with private books and without.
        Testing first category.
        """
        fifth_book = Book.objects.get(book_name='Fifth Book')
        seventh_book = Book.objects.get(book_name='Seventh Book<>&"')

        fifth_book_dict = Utils.generate_sort_dict(fifth_book)
        seventh_book_dict = Utils.generate_sort_dict(seventh_book)

        self.assertEqual(len(Book.sort_by_book_name(self.anonymous_user, self.category2)), 2)
        self.assertEqual(Book.sort_by_book_name(self.anonymous_user, self.category2)[0], seventh_book_dict)

        self.assertEqual(len(Book.sort_by_book_name(self.the_user2.id_user, self.category2)), 2)
        self.assertEqual(Book.sort_by_book_name(self.the_user2.id_user, self.category2)[0], seventh_book_dict)

        self.assertEqual(len(Book.sort_by_book_name(self.the_user1.id_user, self.category2)), 3)
        self.assertEqual(Book.sort_by_book_name(self.the_user1.id_user, self.category2)[0], fifth_book_dict)
        self.assertEqual(Book.sort_by_book_name(self.the_user1.id_user, self.category2)[1], seventh_book_dict)