From 08dad4ad52e8bcf82d0019ee7b5edbb6f051e11a Mon Sep 17 00:00:00 2001 From: Jordan Hyatt Date: Wed, 20 Nov 2024 14:48:56 -0500 Subject: [PATCH] added to test to ensure by-pass logic is covered --- simple_history/tests/tests/test_models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/simple_history/tests/tests/test_models.py b/simple_history/tests/tests/test_models.py index 8bb92ec2..af10f4d6 100644 --- a/simple_history/tests/tests/test_models.py +++ b/simple_history/tests/tests/test_models.py @@ -950,6 +950,12 @@ def test_delete_with_deferred_fields(self): Poll.objects.create(question="what's up sis?", pub_date=today) Poll.objects.only("id").first().delete() Poll.objects.defer("question").all().delete() + # Make sure bypass logic runs + Place.objects.create(name="cool place") + Place.objects.defer("name").first().delete() + with self.modify_settings(SIMPLE_HISTORY_ENABLED=False): + Place.objects.create(name="cool place") + Place.objects.defer("name").all().delete() def test_history_with_custom_queryset(self): PollWithQuerySetCustomizations.objects.create(