def METHOD_NAME(self):
    """Request an object list view and assert that the MAX_PAGE_SIZE setting is enforced"""
    location_type = dcim_models.LocationType.objects.get(name="Campus")
    status = extras_models.Status.objects.get_for_model(dcim_models.Location).first()
    dcim_models.Location.objects.bulk_create(
        [
            dcim_models.Location(name=f"TestLocation{x}", location_type=location_type, status=status)
            for x in range(20)
        ]
    )
    url = reverse("dcim:location_list")
    self.add_permissions("dcim.view_location")
    providers = (circuits_models.Provider(name=f"p-{x}") for x in range(20))
    circuits_models.Provider.objects.bulk_create(providers)
    self.add_permissions("circuits.view_provider")
    self.client.force_login(self.user)
    with self.subTest("query parameter per_page=20 returns 10 rows"):
        response = self.client.get(url, {"per_page": 20})
        self.assertHttpStatus(response, 200)
        self.assertEqual(response.context["paginator"].per_page, 10)
        self.assertEqual(len(response.context["table"].page), 10)
        warning_message = (
            "Requested &quot;per_page&quot; is too large. No more than 10 items may be displayed at a time."
        )
        self.assertIn(warning_message, response.content.decode(response.charset))
    with self.subTest("query parameter per_page=5 returns 5 rows"):
        response = self.client.get(url, {"per_page": 5})
        self.assertHttpStatus(response, 200)
        self.assertEqual(response.context["paginator"].per_page, 5)
        self.assertEqual(len(response.context["table"].page), 5)
    with self.subTest("user config per_page=200 returns 10 rows"):
        self.user.set_config("pagination.per_page", 200, commit=True)
        response = self.client.get(url)
        self.assertHttpStatus(response, 200)
        self.assertEqual(response.context["paginator"].per_page, 10)
        self.assertEqual(len(response.context["table"].page), 10)
    with self.subTest("global config PAGINATE_COUNT=50 returns 10 rows"):
        self.user.clear_config("pagination.per_page", commit=True)
        # Asserting `max_page` restriction on `NautobotUIViewSet`.
        response = self.client.get(reverse("circuits:provider_list"))
        self.assertHttpStatus(response, 200)
        self.assertEqual(response.context["paginator"].per_page, 10)
        self.assertEqual(len(response.context["table"].page), 10)
        warning_message = (
            "Requested &quot;per_page&quot; is too large. No more than 10 items may be displayed at a time."
        )
        self.assertIn(warning_message, response.content.decode(response.charset).replace("\n", ""))