Give the isolated editor precision fixture an active Draft Desk entitlement

This commit is contained in:
Nick Beckley 2026-11-26 17:01:41 +00:00
parent d91dd0dd3e
commit ee417f4680

View File

@ -15,6 +15,7 @@ internal static class CharacterEditorPrecisionDatabaseTests
try
{
user=await db.QuerySingleAsync<int>("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);