예제 #1
0
def test_file_path_long():
    """File path truncates the file name if necessary"""
    file_name = "a" * 100 + ".ext"
    assert len(file_path("base", None, file_name)) == 92
예제 #2
0
파일: models.py 프로젝트: jacqui/squarelet
def organization_file_path(instance, filename):
    return file_path("org_avatars", instance, filename)
예제 #3
0
def test_file_path_normal():
    """File path just appends base and filename if under the limit"""
    assert file_path("base", None, "filename.ext") == "base/filename.ext"
예제 #4
0
def user_file_path(instance, filename):
    return file_path("avatars", instance, filename)