mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-23 09:16:51 +00:00
fix(backup): trim auto-snapshots on setting the quotas
This commit is contained in:
parent
ad9384c850
commit
56be3d9c31
|
@ -396,6 +396,9 @@ class Backups:
|
|||
)
|
||||
)
|
||||
|
||||
for service in get_all_services():
|
||||
Backups._prune_auto_snaps(service)
|
||||
|
||||
# Restoring
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -520,8 +520,10 @@ def test_too_many_auto(backups, dummy_service):
|
|||
# Retroactivity
|
||||
quota.total = 1
|
||||
Backups.set_autobackup_quotas(quota)
|
||||
snap5 = Backups.back_up(dummy_service, BackupReason.AUTO)
|
||||
snaps = Backups.get_snapshots(dummy_service)
|
||||
assert len(snaps) == 1
|
||||
|
||||
snap5 = Backups.back_up(dummy_service, BackupReason.AUTO)
|
||||
snaps = Backups.get_snapshots(dummy_service)
|
||||
assert len(snaps) == 1
|
||||
assert snap5 in snaps
|
||||
|
|
Loading…
Reference in a new issue