

def test_import_by_path(self):
    cls = import_by_path('embed_video.utils.import_by_path')
    self.assertEqual(cls, import_by_path)
    for path in ('no_dots_in_path', 'unexistent.path', 'utils_tests.unexistent'):
        self.assertRaises(ImproperlyConfigured, import_by_path, path)
    with self.assertRaises(ImproperlyConfigured) as cm:
        import_by_path('unexistent.module.path', error_prefix='Foo')
    self.assertTrue(str(cm.exception).startswith('Foo'))

dataset/ETHPy150Open yetty/django-embed-video/embed_video/tests/tests_utils.py ModuleImportTestCase.test_import_by_path/original