              # context manager, not those when the class was instantiated
              self.assertEqual('override', settings.TEST)
              self.assertRaises(AttributeError, getattr, settings, 'TEST2')
  
          self.assertRaises(AttributeError, getattr, settings, 'TEST')
          self.assertRaises(AttributeError, getattr, settings, 'TEST2')
  
  
  class TestComplexSettingOverride(SimpleTestCase):
      def setUp(self):
          self.old_warn_override_settings = signals.COMPLEX_OVERRIDE_SETTINGS.copy()
 
</s> remove             self.assertRaises(AttributeError, getattr, settings, 'TEST2')
 </s> add             with self.assertRaises(AttributeError):
                getattr(settings, 'TEST2') </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') </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')
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST')
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST2')
              # context manager, not those when the class was instantiated
              self.assertEqual('override', settings.TEST)
              self.assertRaises(AttributeError, getattr, settings, 'TEST2')
  
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST')
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST2')
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST')
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST2')
  
  
  class TestComplexSettingOverride(SimpleTestCase):
      def setUp(self):
          self.old_warn_override_settings = signals.COMPLEX_OVERRIDE_SETTINGS.copy()
keep keep keep keep replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/settings_tests/tests.py