def test_get_related_objects_selected_book_unknown_user(self):
        """
        Must generate selected book related data for unknown (anonymous) users.
        """
        third_book = Book.objects.get(book_name='Third Book')
        sixth_book = Book.objects.get(book_name='Sixth Book')

        self.assertTrue(isinstance(Book.get_related_objects_selected_book(self.anonymous_user, third_book.id), dict))

        related_third_book = Book.get_related_objects_selected_book(self.anonymous_user, third_book.id)
        related_sixth_book = Book.get_related_objects_selected_book(self.anonymous_user, sixth_book.id)

        self.assertEqual(related_third_book['book'], third_book)
        self.assertEqual(related_third_book['avg_book_rating'], {'rating__avg': 6.0})
        self.assertEqual(related_third_book['book_rating_count'], 3)
        self.assertEqual(related_third_book['added_book'], None)
        self.assertEqual(related_third_book['comments'].count(), 1)
        self.assertEqual(related_third_book['comments'][0],
                         BookComment.objects.filter(id_book=third_book).order_by('-id')[0])

        self.assertEqual(related_sixth_book['book'], sixth_book)
        self.assertEqual(related_sixth_book['avg_book_rating'], {'rating__avg': 4.0})
        self.assertEqual(related_sixth_book['book_rating_count'], 1)
        self.assertEqual(related_sixth_book['added_book'], None)
        self.assertEqual(related_sixth_book['comments'].count(), 0)

        AddedBook.objects.create(id_user=self.the_user5, id_book=third_book)
        BookRating.objects.create(id_user=self.the_user6, id_book=third_book, rating=10)
        BookComment.objects.create(id_user=self.the_user6, id_book=third_book, text='TEST TEXT 2')

        related_third_book = Book.get_related_objects_selected_book(self.anonymous_user, third_book.id)

        self.assertEqual(related_third_book['book'], third_book)
        self.assertEqual(related_third_book['avg_book_rating'], {'rating__avg': 7.0})
        self.assertEqual(related_third_book['book_rating_count'], 4)
        self.assertEqual(related_third_book['added_book'], None)
        self.assertEqual(related_third_book['comments'].count(), 2)