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
def organization_file_path(instance, filename): return file_path("org_avatars", instance, filename)
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"
def user_file_path(instance, filename): return file_path("avatars", instance, filename)