def get_backup_filename(filename):
    parent = os.path.dirname(filename)
    parts = os.path.basename(filename).split(".")
    parts.insert(-1,"old")
    backname = os.path.join(parent,".".join(parts))
    while os.path.exists(backname):
        parts.insert(-1,"old")
        backname = os.path.join(parent,".".join(parts))
    return backname
Shortcut for RequestFactory; adds request.user.
dataset/ETHPy150Open cloudmatrix/esky/esky/util.py/get_backup_filename--crossover with--dataset/ETHPy150Open mozilla/moztrap/tests/view/lists/test_actions.py/ActionsTest.req