          self.assertRaises(ImportError, import_module, 'utils_tests.test_module.no_such_module')
  
          # A child that doesn't exist, but is the name of a package on the path
          self.assertFalse(module_has_submodule(test_module, 'django'))
          self.assertRaises(ImportError, import_module, 'utils_tests.test_module.django')
  
          # Don't be confused by caching of import misses
          import types  # NOQA: causes attempted import of utils_tests.types
          self.assertFalse(module_has_submodule(sys.modules['utils_tests'], 'types'))
  
 
</s> remove         self.assertRaises(ImportError, import_module, 'utils_tests.test_module.no_such_module')
 </s> add         with self.assertRaises(ImportError):
            import_module('utils_tests.test_module.no_such_module') </s> remove         self.assertRaises(ImportError, import_module, 'utils_tests.test_module.bad_module')
 </s> add         with self.assertRaises(ImportError):
            import_module('utils_tests.test_module.bad_module') </s> remove             self.assertRaises(ImportError, import_module, 'egg_module.bad_module')
 </s> add             with self.assertRaises(ImportError):
                import_module('egg_module.bad_module') </s> remove             self.assertRaises(ImportError, import_module, 'egg_module.sub1.sub2.bad_module')
 </s> add             with self.assertRaises(ImportError):
                import_module('egg_module.sub1.sub2.bad_module') </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')
        with self.assertRaises(ImportError):
            import_module('utils_tests.test_module.django')
          self.assertRaises(ImportError, import_module, 'utils_tests.test_module.no_such_module')
  
          # A child that doesn't exist, but is the name of a package on the path
          self.assertFalse(module_has_submodule(test_module, 'django'))
        with self.assertRaises(ImportError):
            import_module('utils_tests.test_module.django')
  
          # Don't be confused by caching of import misses
          import types  # NOQA: causes attempted import of utils_tests.types
          self.assertFalse(module_has_submodule(sys.modules['utils_tests'], 'types'))
  
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