def METHOD_NAME(self, populate):
    """
    Test management command with invalid site domain.
    """
    fake_site_domain = 'fake-site-domain'
    with mock.patch('six.moves.input', return_value=populate):
        call_command(
            "populate_created_on_site_user_attribute",
            "--users", self.user_ids,
            "--site-domain", fake_site_domain
        )
    for user in self.users:
        if populate == 'y':
            assert UserAttribute.get_user_attribute(user, CREATED_ON_SITE) == fake_site_domain
        else:
            assert UserAttribute.get_user_attribute(user, CREATED_ON_SITE) is None