From Django [docs](https://docs.djangoproject.com/en/dev/topics/settings/#altering-settings-at-runtime):

> 
> You shouldn’t alter settings in your applications at runtime. For
>  example, don’t do this in a view:
> 
> 
> 
> ```
> from django.conf import settings
> 
> settings.DEBUG = True   # Don't do this!
> 
> ```
> 
> The only place you should assign to settings is in a settings file.
> 
> 
> 

I've noticed that Django testing code [does](https://github.com/django/django/blob/2.0/django/test/utils.py#L125) alter settings. Why is it ok to do it there?