          self.assertEqual('test', settings.TEST)
          del settings.TEST
  
      def test_override_doesnt_leak(self):
          self.assertRaises(AttributeError, getattr, settings, 'TEST')
          with self.settings(TEST='override'):
              self.assertEqual('override', settings.TEST)
              settings.TEST = 'test'
          self.assertRaises(AttributeError, getattr, settings, 'TEST')
  
 
</s> remove         self.assertRaises(AttributeError, getattr, settings, 'TEST')
 </s> add         with self.assertRaises(AttributeError):
            getattr(settings, 'TEST') </s> remove         self.assertRaises(AttributeError, getattr, settings, 'TEST')
 </s> add         with self.assertRaises(AttributeError):
            getattr(settings, 'TEST') </s> remove         self.assertRaises(AttributeError, getattr, settings, 'TEST')
 </s> add         with self.assertRaises(AttributeError):
            getattr(settings, 'TEST') </s> remove         self.assertRaises(AttributeError, getattr, settings, 'TEST')
 </s> add         with self.assertRaises(AttributeError):
            getattr(settings, 'TEST') </s> remove         self.assertRaises(AttributeError, getattr, settings, 'TEST')
        self.assertRaises(AttributeError, getattr, settings, 'TEST2')
 </s> add         with self.assertRaises(AttributeError):
            getattr(settings, 'TEST')
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST2')
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST')
          self.assertEqual('test', settings.TEST)
          del settings.TEST
  
      def test_override_doesnt_leak(self):
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST')
          with self.settings(TEST='override'):
              self.assertEqual('override', settings.TEST)
              settings.TEST = 'test'
          self.assertRaises(AttributeError, getattr, settings, 'TEST')
  
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/settings_tests/tests.py