def test_import_string_unexistent(self):
     with self.assertRaises(ImportError):
         import_string("tests.utils.unexistent")
 def test_import_string_success(self):
     cls = import_string(
         "draftjs_exporter.utils.module_loading.import_string"
     )
     self.assertEqual(cls, import_string)
 def test_import_string_invalid(self):
     with self.assertRaises(ImportError):
         import_string("no_dots_in_path")
Exemplo n.º 4
0
 def use(cls, engine: str) -> None:
     """
     Choose which DOM implementation to use.
     """
     cls.dom = import_string(engine)
Exemplo n.º 5
0
 def use(cls, engine):
     """
     Choose which DOM implementation to use.
     """
     cls.dom = import_string(engine)
 def test_import_string_unexistent(self):
     with self.assertRaises(ImportError):
         import_string('tests.utils.unexistent')
 def test_import_string_invalid(self):
     with self.assertRaises(ImportError):
         import_string('no_dots_in_path')
 def test_import_string_success(self):
     cls = import_string('draftjs_exporter.utils.module_loading.import_string')
     self.assertEqual(cls, import_string)