def METHOD_NAME(self):
    """
    On a draft page, the "get_related_category_pages" template tag should inject in the
    context, all categories related to a queryset of pages via a CategoryPlugin.
    """
    page_main = PageFactory(
        template="richie/single_column.html", should_publish=True
    )
    page1, page2 = PageFactory.create_batch(
        2, template="richie/single_column.html", should_publish=True
    )
    (
        category_draft_page1_draft,
        category_draft_page1_published,
        category_draft_page2_draft,
        category_draft_page2_published,
    ) = [c.extended_object for c in CategoryFactory.create_batch(4)]
    (
        category_published_page1_draft,
        category_published_page1_published,
        category_published_page2_draft,
        category_published_page2_published,
    ) = [
        c.extended_object
        for c in CategoryFactory.create_batch(4, should_publish=True)
    ]
    self._attach_categories(
        page1, category_draft_page1_draft, category_published_page1_draft
    )
    self._attach_categories(
        page1.get_public_object(),
        category_draft_page1_published,
        category_published_page1_published,
    )
    self._attach_categories(
        page2, category_draft_page2_draft, category_published_page2_draft
    )
    self._attach_categories(
        page2.get_public_object(),
        category_draft_page2_published,
        category_published_page2_published,
    )
    request = RequestFactory().get("/")
    template = (
        "{% load cms_tags category_tags %}"
        "{% get_related_category_pages pages as categories %}"
        "{% for category in categories %}{{ category.extended_object.id }}{% endfor %}"
    )
    # 1. Test categories present on the draft page
    # - Linked with one of the pages
    with self.assertNumQueries(1):
        output = self.render_template_obj(
            template, {"current_page": page_main, "pages": [page1]}, request
        )
    expected = [category_draft_page1_draft, category_published_page1_draft]
    self.assertEqual(output, "".join([str(c.id) for c in expected]))
    # - Linked with either of the 2 pages
    with self.assertNumQueries(1):
        output = self.render_template_obj(
            template, {"current_page": page_main, "pages": [page1, page2]}, request
        )
    expected = [
        category_draft_page1_draft,
        category_draft_page2_draft,
        category_published_page1_draft,
        category_published_page2_draft,
    ]
    self.assertEqual(output, "".join([str(c.id) for c in expected]))
    # - Linked with a page in a different publication status
    with self.assertNumQueries(1):
        output = self.render_template_obj(
            template,
            {"current_page": page_main, "pages": [page1.get_public_object()]},
            request,
        )
    expected = [category_draft_page1_draft, category_published_page1_draft]
    self.assertEqual(output, "")
    # 2. Test categories on the public page
    current_page = page_main.get_public_object()
    # - Linked with one of the pages
    with self.assertNumQueries(1):
        output = self.render_template_obj(
            template,
            {"current_page": current_page, "pages": [page1.get_public_object()]},
            request,
        )
    self.assertEqual(
        output, str(category_published_page1_published.get_public_object().id)
    )
    # - Linked with either of the 2 pages
    with self.assertNumQueries(1):
        output = self.render_template_obj(
            template,
            {
                "current_page": current_page,
                "pages": [page1.get_public_object(), page2.get_public_object()],
            },
            request,
        )
    expected = [
        category_published_page1_published.get_public_object(),
        category_published_page2_published.get_public_object(),
    ]
    self.assertEqual(output, "".join([str(c.id) for c in expected]))
    # - Linked with a page in a different publication status
    with self.assertNumQueries(1):
        output = self.render_template_obj(
            template,
            {"current_page": current_page, "pages": [page1]},
            request,
        )
    self.assertEqual(output, "")