Change: enable auditlog by default, fix import / export (#6267)

This commit is contained in:
shamoon
2024-04-04 11:51:15 -07:00
committed by GitHub
parent 00b04c2e86
commit 0f8b2e69c9
7 changed files with 47 additions and 16 deletions

View File

@@ -780,3 +780,17 @@ class TestExportImport(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
self.assertEqual(ContentType.objects.count(), num_content_type_objects)
self.assertEqual(Permission.objects.count(), num_permission_objects + 1)
def test_exporter_with_auditlog_disabled(self):
shutil.rmtree(os.path.join(self.dirs.media_dir, "documents"))
shutil.copytree(
os.path.join(os.path.dirname(__file__), "samples", "documents"),
os.path.join(self.dirs.media_dir, "documents"),
)
with override_settings(
AUDIT_LOG_ENABLED=False,
):
manifest = self._do_export(use_filename_format=True)
for obj in manifest:
self.assertNotEqual(obj["model"], "auditlog.logentry")