def METHOD_NAME(self):
    invalid = (
        ["testserver"],
        ["example.com"],
        ["localhost", "other"],
    )
    for bad_config in invalid:
        with self.subTest(ALLOWED_HOSTS=bad_config):
            with override_settings(ALLOWED_HOSTS=bad_config):
                errors = check_openzaak_domain(None)
                self.assertEqual(len(errors), 1)
                self.assertEqual(errors[0].id, "openzaak.settings.E002")
            with override_settings(OPENZAAK_REWRITE_HOST=False):
                errors = check_openzaak_domain(None)
            self.assertEqual(len(errors), 0)