          cls = import_string('django.utils.module_loading.import_string')
          self.assertEqual(cls, import_string)
  
          # Test exceptions raised
          self.assertRaises(ImportError, import_string, 'no_dots_in_path')
          msg = 'Module "utils_tests" does not define a "unexistent" attribute'
          with six.assertRaisesRegex(self, ImportError, msg):
              import_string('utils_tests.unexistent')
  
  
 
</s> remove             self.assertRaises(ImportError, import_module, 'egg_module.sub1.sub2.no_such_module')
 </s> add             with self.assertRaises(ImportError):
                import_module('egg_module.sub1.sub2.no_such_module') </s> remove         self.assertRaises(Http404, shortcut, request, user_ct.id, obj.id)
 </s> add         with self.assertRaises(Http404):
            shortcut(request, user_ct.id, obj.id) </s> remove         self.assertRaises(ObjectDoesNotExist, get_current_site, request)
 </s> add         with self.assertRaises(ObjectDoesNotExist):
            get_current_site(request) </s> remove         self.assertRaises(ValueError, d.save)
        # ValueError: MySQL backend does not support timezone-aware datetimes.
 </s> add         # MySQL backend does not support timezone-aware datetimes.
        with self.assertRaises(ValueError):
            d.save() </s> remove         self.assertRaises(ObjectDoesNotExist, Site.objects.get_current)
 </s> add         with self.assertRaises(ObjectDoesNotExist):
            Site.objects.get_current()
        with self.assertRaises(ImportError):
            import_string('no_dots_in_path')
          cls = import_string('django.utils.module_loading.import_string')
          self.assertEqual(cls, import_string)
  
          # Test exceptions raised
        with self.assertRaises(ImportError):
            import_string('no_dots_in_path')
          msg = 'Module "utils_tests" does not define a "unexistent" attribute'
          with six.assertRaisesRegex(self, ImportError, msg):
              import_string('utils_tests.unexistent')
  
  
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/utils_tests/test_module_loading.py