def test_raise_import_error_when_class_or_attribute_not_found(self): with pytest.raises(ImportError): import_string('siilo.storages.filesystem.FooBarBaz')
def test_raise_import_error_when_string_is_not_dotted_path(self): with pytest.raises(ImportError): import_string('hokus pokus')
def test_import_class_from_string(self): cls = import_string('siilo.storages.filesystem.FileSystemStorage') from siilo.storages.filesystem import FileSystemStorage assert cls == FileSystemStorage