From ee417f4680a89719756dbbbfcb75c37c1429f64f Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Thu, 26 Nov 2026 17:01:41 +0000 Subject: [PATCH] Give the isolated editor precision fixture an active Draft Desk entitlement --- PlotLine.Tests/CharacterEditorPrecisionDatabaseTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PlotLine.Tests/CharacterEditorPrecisionDatabaseTests.cs b/PlotLine.Tests/CharacterEditorPrecisionDatabaseTests.cs index b3aba957..af0f2025 100644 --- a/PlotLine.Tests/CharacterEditorPrecisionDatabaseTests.cs +++ b/PlotLine.Tests/CharacterEditorPrecisionDatabaseTests.cs @@ -15,6 +15,7 @@ internal static class CharacterEditorPrecisionDatabaseTests try { user=await db.QuerySingleAsync("INSERT dbo.AppUser(Email,DisplayName,PasswordHash) VALUES(@Email,N'Editor precision fixture',N'not-an-authenticatable-password-hash');SELECT CONVERT(int,SCOPE_IDENTITY());",new{Email=$"precision-{Guid.NewGuid():N}@example.invalid"}); + await db.ExecuteAsync("INSERT dbo.SubscriptionOverride(UserID,SubscriptionLevelID,StartDateUTC,ExpiryDateUTC,Reason,CreatedByUserID,ModifiedByUserID) SELECT @UserID,SubscriptionLevelID,DATEADD(minute,-1,SYSUTCDATETIME()),DATEADD(hour,1,SYSUTCDATETIME()),N'Isolated editor precision fixture',@UserID,@UserID FROM dbo.SubscriptionLevel WHERE Name=N'DraftDesk'",new{UserID=user}); project=await projects.SaveAsync(new(){ProjectName="Isolated editor precision fixture"},user,null); var id=await characters.SaveCharacterAsync(new(){ProjectID=project,CharacterName="Synthetic cat",CharacterTypeCode="animal",Species="Cat",DefaultDescription="Complete fixture biography",UpdateClassification=true},userId:user); await db.ExecuteAsync("UPDATE dbo.Characters SET UpdatedDate=CONVERT(datetime2(7),'2026-11-26T12:34:56.1234567') WHERE CharacterID=@ID",new{ID=id}); @@ -33,7 +34,7 @@ internal static class CharacterEditorPrecisionDatabaseTests finally { if(project>0){await projects.ArchiveForOwnerAsync(project,user);await projects.HardDeleteForOwnerAsync(project,user);} - if(user>0&&!await new UserRepository(factory).HardDeleteAccountDataAsync(user))throw new Exception("Fixture cleanup failed"); + if(user>0){await db.ExecuteAsync("DELETE dbo.SubscriptionOverride WHERE UserID=@UserID",new{UserID=user});if(!await new UserRepository(factory).HardDeleteAccountDataAsync(user))throw new Exception("Fixture cleanup failed");} } } private sealed record Settings(string Server,string Database,string Password);