forked from gongxuegit/tiku-backend.net
feat: enforce tenant isolation and shared question bank
This commit is contained in:
@@ -66,7 +66,7 @@ public sealed class AssetManagementEndpointTests
|
||||
var listItem = Assert.Single(list.RootElement.GetProperty("items").EnumerateArray());
|
||||
Assert.Equal(assetId, listItem.GetProperty("id").GetGuid());
|
||||
|
||||
using var scope = factory.Services.CreateScope();
|
||||
using var scope = factory.CreateSystemScope();
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<TikuDbContext>();
|
||||
var asset = dbContext.ContentAssets.Single(asset => asset.Id == assetId);
|
||||
Assert.Equal(seed.TenantId, asset.TenantId);
|
||||
@@ -118,7 +118,7 @@ public sealed class AssetManagementEndpointTests
|
||||
Assert.Equal("Verified", body.RootElement.GetProperty("item").GetProperty("uploadStatus").GetString());
|
||||
Assert.Equal(2048, body.RootElement.GetProperty("metadata").GetProperty("sizeBytes").GetInt64());
|
||||
|
||||
using var scope = factory.Services.CreateScope();
|
||||
using var scope = factory.CreateSystemScope();
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<TikuDbContext>();
|
||||
var asset = dbContext.ContentAssets.Single(asset => asset.Id == assetId);
|
||||
Assert.Equal(AssetUploadStatus.Verified, asset.UploadStatus);
|
||||
@@ -299,7 +299,7 @@ public sealed class AssetManagementEndpointTests
|
||||
"/api/auth/login/password",
|
||||
new PasswordLoginDto
|
||||
{
|
||||
TenantId = seed.TenantId,
|
||||
TenantCode = seed.TenantId.ToString("N"),
|
||||
Phone = seed.Phone,
|
||||
Password = "passw0rd!"
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user