forked from gongxuegit/tiku-backend.net
feat: enforce tenant isolation and shared question bank
This commit is contained in:
@@ -272,16 +272,16 @@ public sealed class CommerceEndpointTests
|
||||
signatureValid = true
|
||||
};
|
||||
var firstNotify = await client.PostAsJsonAsync(
|
||||
$"/api/commerce/payments/notify/wechat-pay?tenantId={seed.TenantId}",
|
||||
$"/api/commerce/payments/notify/wechat-pay?tenantCode={seed.TenantId:N}",
|
||||
payload);
|
||||
var secondNotify = await client.PostAsJsonAsync(
|
||||
$"/api/commerce/payments/notify/wechat-pay?tenantId={seed.TenantId}",
|
||||
$"/api/commerce/payments/notify/wechat-pay?tenantCode={seed.TenantId:N}",
|
||||
payload);
|
||||
await LoginAsync(client, seed);
|
||||
var entitlement = await (await client.GetAsync("/api/commerce/entitlements/current"))
|
||||
.Content
|
||||
.ReadFromJsonAsync<CurrentEntitlementItem>();
|
||||
using var scope = factory.Services.CreateScope();
|
||||
using var scope = factory.CreateSystemScope();
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<TikuDbContext>();
|
||||
var events = dbContext.PaymentEvents.Count(item => item.EventId == "notify-001");
|
||||
|
||||
@@ -302,7 +302,7 @@ public sealed class CommerceEndpointTests
|
||||
|
||||
client.DefaultRequestHeaders.Authorization = null;
|
||||
var notifyResponse = await client.PostAsJsonAsync(
|
||||
$"/api/commerce/payments/notify/wechat-pay?tenantId={seed.TenantId}",
|
||||
$"/api/commerce/payments/notify/wechat-pay?tenantCode={seed.TenantId:N}",
|
||||
new
|
||||
{
|
||||
eventId = "notify-invalid",
|
||||
@@ -403,7 +403,7 @@ public sealed class CommerceEndpointTests
|
||||
"/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