def override_in_model(self, switch_name, active=True): """ Overrides the active value for the given switch for the duration of this contextmanager. Note: The value is overridden in the model, not the request cache. """ namespaced_switch_name = self._namespaced_name(switch_name) with waffle_override_switch(namespaced_switch_name, active): log.info(u"%sSwitch '%s' set to %s in model.", self.log_prefix, namespaced_switch_name, active) yield
def override_in_model(self, switch_name, active=True): """ Overrides the active value for the given switch for the duration of this contextmanager. Note: The value is overridden in the model, not the request cache. """ namespaced_switch_name = self._namespaced_setting_name(switch_name) with waffle_override_switch(namespaced_switch_name, active): log.info(u"%sSwitch '%s' set to %s in model.", self.log_prefix, namespaced_switch_name, active) yield
def override_in_model(self, switch_name, active=True): """ Overrides the active value for the given switch for the duration of this contextmanager. Note: The value is overridden in the model, not the request cache. """ # Import is placed here to avoid model import at project startup. from waffle.testutils import override_switch as waffle_override_switch namespaced_switch_name = self._namespaced_name(switch_name) with waffle_override_switch(namespaced_switch_name, active): log.info(u"%sSwitch '%s' set to %s in model.", self.log_prefix, namespaced_switch_name, active) yield