'override_settings uses the actual _wrapped attribute at
runtime, not when it was instantiated.'

def test_override_settings_nested(self):

    with self.assertRaises(AttributeError):
        getattr(settings, 'TEST')
    with self.assertRaises(AttributeError):
        getattr(settings, 'TEST2')
    inner = override_settings(TEST2='override')
    with override_settings(TEST='override'):
        self.assertEqual('override', settings.TEST)
        with inner:
            self.assertEqual('override', settings.TEST)
            self.assertEqual('override', settings.TEST2)
        self.assertEqual('override', settings.TEST)
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST2')
    with self.assertRaises(AttributeError):
        getattr(settings, 'TEST')
    with self.assertRaises(AttributeError):
        getattr(settings, 'TEST2')
