def test_sort_by_book_name_category1(self):
        """
        Must generate correct dictionaries for anonymous users, users with private books and without.
        Testing first category.
        """
        first_book = Book.objects.get(book_name='First Book')
        third_book = Book.objects.get(book_name='Third Book')
        fourth_book = Book.objects.get(book_name='Fourth Book')
        first_book_dict = Utils.generate_sort_dict(first_book)
        third_book_dict = Utils.generate_sort_dict(third_book)
        fourth_book_dict = Utils.generate_sort_dict(fourth_book)

        self.assertTrue(isinstance(Book.sort_by_book_name(self.anonymous_user, self.category1), list))
        self.assertEqual(len(Book.sort_by_book_name(self.anonymous_user, self.category1)), 3)
        self.assertEqual(Book.sort_by_book_name(self.anonymous_user, self.category1)[0], fourth_book_dict)
        self.assertEqual(Book.sort_by_book_name(self.anonymous_user, self.category1)[2], third_book_dict)

        self.assertEqual(len(Book.sort_by_book_name(self.the_user2.id_user, self.category1)), 3)
        self.assertEqual(Book.sort_by_book_name(self.the_user2.id_user, self.category1)[0], fourth_book_dict)
        self.assertEqual(Book.sort_by_book_name(self.the_user2.id_user, self.category1)[2], third_book_dict)

        self.assertEqual(len(Book.sort_by_book_name(self.the_user1.id_user, self.category1)), 4)
        self.assertEqual(Book.sort_by_book_name(self.the_user1.id_user, self.category1)[0], first_book_dict)
        self.assertEqual(Book.sort_by_book_name(self.the_user1.id_user, self.category1)[3], third_book_dict)