If you're creating a bug/problem report, please include followings:
ABP Framework version: v4.4.3
UI type: Angular
DB provider: EF Core
Tiered (MVC) or Identity Server Separated (Angular): no
Steps to reproduce the issue:"
If I generatean entity with a required navigation property I get errors when running unit tests
All unit tests fail and get the error Microsoft.Data.Sqlite.SqliteException : SQLite Error 19: 'FOREIGN KEY constraint failed'.
I fixed the issue by adding the required field on my entity test files, but anytime I regenerate my entity I need to fix it again in both test files MyEntitySetAppServiceTests.cs
and MyEntitySetDataSeedContributor.cs
by adding a value for this required navigation property.
Will it be possible to fix the test generation to add it automatically? Because of this issue, I do not put navigation property required in any of my entities (even if they should), as it will need too much extra work anytimes we regenerate entities. Otherwise, is there any other way to make it works without having to change it after each generation?
Thanks
3 Answer(s)
-
0
this has been addressed and fixed in v5.0. v5.0.0-beta.1 is now online but you can wait for the v5-rc version to update your project. until your update, you can manually fix the case
-
0
Good to know, thank for the update.
I will close the issue once I will have tried it then
-
0
ok thank you. we can keep this open.