def test_get_related_objects_selected_book_with_user_key(self):
        """
        Tests returning data for related objects for selected book with 'user_key' attribute, meaning that
        user is anonymous (i.e. not logged) but with using user key. Done for API requests access.
        """
        third_book = Book.objects.get(book_name='Third Book')
        related_third_book = Book.get_related_objects_selected_book(
            self.anonymous_user, third_book.id, self.the_user1.auth_token
        )

        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'],
                         AddedBook.objects.get(id_book=third_book, id_user=self.the_user1))
        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])