Skip to content

Commit

Permalink
Fixed test now that save of content types creates a cleanup policy
Browse files Browse the repository at this point in the history
  • Loading branch information
bergmania committed Nov 2, 2021
1 parent ab06d21 commit 456b8a8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public void PerformContentVersionCleanup_WithNoKeepPeriods_DeletesEverythingExce
// With 11M Property data

var contentTypeA = MockedContentTypes.CreateSimpleContentType("contentTypeA", "contentTypeA");
// Kill all historic
contentTypeA.HistoryCleanup.PreventCleanup = false;
contentTypeA.HistoryCleanup.KeepAllVersionsNewerThanDays = 0;
contentTypeA.HistoryCleanup.KeepLatestVersionPerDayForDays = 0;

ServiceContext.FileService.SaveTemplate(contentTypeA.DefaultTemplate);
ServiceContext.ContentTypeService.Save(contentTypeA);

Expand All @@ -44,8 +49,7 @@ public void PerformContentVersionCleanup_WithNoKeepPeriods_DeletesEverythingExce
Debug.Assert(before.ContentVersions == 12); // 10 historic + current draft + current published
Debug.Assert(before.PropertyData == 12 * 3); // CreateSimpleContentType = 3 props

// Kill all historic
InsertCleanupPolicy(contentTypeA, 0, 0);


((IContentVersionService)ServiceContext.ContentService).PerformContentVersionCleanup(DateTime.Now.AddHours(1));

Expand Down

0 comments on commit 456b8a8

Please sign in to comment.