Browse Source
Disable dynamic permissions and features in unit test.
pull/15911/head
maliming
3 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
13 additions and
0 deletions
-
templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
|
|
|
@ -6,7 +6,9 @@ using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
|
using Volo.Abp.EntityFrameworkCore.Sqlite; |
|
|
|
using Volo.Abp.FeatureManagement; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.PermissionManagement; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
|
|
|
|
namespace MyCompanyName.MyProjectName.EntityFrameworkCore; |
|
|
|
@ -22,7 +24,18 @@ public class MyProjectNameEntityFrameworkCoreTestModule : AbpModule |
|
|
|
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
Configure<FeatureManagementOptions>(options => |
|
|
|
{ |
|
|
|
options.SaveStaticFeaturesToDatabase = false; |
|
|
|
options.IsDynamicFeatureStoreEnabled = false; |
|
|
|
}); |
|
|
|
Configure<PermissionManagementOptions>(options => |
|
|
|
{ |
|
|
|
options.SaveStaticPermissionsToDatabase = false; |
|
|
|
options.IsDynamicPermissionStoreEnabled = false; |
|
|
|
}); |
|
|
|
context.Services.AddAlwaysDisableUnitOfWorkTransaction(); |
|
|
|
|
|
|
|
ConfigureInMemorySqlite(context.Services); |
|
|
|
} |
|
|
|
|
|
|
|
|