def METHOD_NAME(self):
    def has_license_alert(component):
        return component.alert_set.filter(name="MissingLicense").exists()
    # No license and public project
    component = self.component
    component.update_alerts()
    self.assertTrue(has_license_alert(component))
    # Private project
    component.project.access_control = component.project.ACCESS_PRIVATE
    component.update_alerts()
    self.assertFalse(has_license_alert(component))
    # Public, but login required
    component.project.access_control = component.project.ACCESS_PUBLIC
    with override_settings(LOGIN_REQUIRED_URLS=["some"]):
        component.update_alerts()
        self.assertFalse(has_license_alert(component))
    # Filtered licenses
    with override_settings(LICENSE_FILTER=set()):
        component.update_alerts()
        self.assertFalse(has_license_alert(component))
    # Filtered licenses
    with override_settings(LICENSE_FILTER={"proprietary"}):
        component.update_alerts()
        self.assertTrue(has_license_alert(component))
    # Set license
    component.license = "license"
    component.update_alerts()
    self.assertFalse(has_license_alert(component))