Use natural foreign keys in test fixtures
When adding, editing or deleting Django models, we sometimes have to regenerate the test fixtures because we get issues with the Django permissions, as their auto-incremented primary key can get conflicts. We are including Django's auth
app in our test fixtures because we needed it for the generic foreign key on rights. I hit this in !2451 (merged).
The dumpdata
command supports the --natural-foreign
and --natural-primary
options which try to use natural foreign keys when available. The content types used in the Right's content_type
foreign key are referred to as ["documents", "corpus"]
or ["users", "group"]
instead of a hardcoded integer primary key. This removes the need for the auth
app and reduces the risk of the test fixtures breaking for no good reason.
Merge request reports
Activity
changed milestone to %Arkindex 1.6.4
added P3 label
requested review from @babadie
assigned to @erouchet
added 3 commits
-
b9d4f14f...696088ca - 2 commits from branch
release-1.6.4
- c669b565 - Use natural foreign keys in test fixture
-
b9d4f14f...696088ca - 2 commits from branch
enabled an automatic merge when all merge checks for c669b565 pass