Exemplo n.º 1
0
def test_get_nonexisting_storage_module():
    """
    get_storage_class raises an error if the requested module don't exist.
    """
    # Error message may or may not be the fully qualified path.
    with pytest.raises(ImportError):
        get_storage_class("storages.non_existing.NonExistingStoage")
Exemplo n.º 2
0
def test_get_invalid_storage_module():
    """
    get_storage_class raises an error if the requested import don't exist.
    """
    with pytest.raises(ValueError):
        get_storage_class("NonExistingStorage")
Exemplo n.º 3
0
def test_get_nonexisting_storage_class():
    """
    get_storage_class raises an error if the requested class don't exist.
    """
    with pytest.raises(AttributeError):
        get_storage_class("storages.NonExistingStorage")
Exemplo n.º 4
0
def test_get_filesystem_storage():
    """
    get_storage_class returns the class for a storage backend name/path.
    """
    assert get_storage_class("storages.FileSystemStorage") is FileSystemStorage