@contextmanager<EOL>def django_setting(name, value):
original_value = getattr(settings, name)<EOL>setattr(settings, name, value)<EOL>try:<EOL><INDENT>yield<EOL><DEDENT>finally:<EOL><INDENT>setattr(settings, name, original_value)<EOL><DEDENT>
Generator that mutates the django.settings object during the context of a test run.

:param name: The setting name to be affected
:param value: The setting value to be defined during the execution
:return: