def METHOD_NAME(self):
    factory = RequestFactory()
    bad_referers = (
        "http://otherdomain/bar/",
        "http://otherdomain/admin/forms/form/",
    )
    for referer in bad_referers:
        with self.subTest(referer=referer):
            request = factory.get(
                "/api/v1/foo", HTTP_REFERER=referer, SCRIPT_NAME="/of"
            )
            self.assertFalse(is_admin_request(request))