If there is a setting that does not exist, settings_stub will gladly add it, but will not remove it.
with settings_stub(SOME_SETTING_THAT_DOES_NOT_EXIST=1):
print(settings.SOME_SETTING_THAT_DOES_NOT_EXIST) # Prints 1
print(settings.SOME_SETTING_THAT_DOES_NOT_EXIST) # Prints 1 instead of raising AttributeError
It ought to remove the setting if it did not exist originally.