From 2594da568d1e46aefe49ee55e87288fbee237dd5 Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Tue, 19 Nov 2024 14:45:54 -0600 Subject: [PATCH] Only run tests when the db can update conflicts. --- simple_history/tests/tests/test_utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/simple_history/tests/tests/test_utils.py b/simple_history/tests/tests/test_utils.py index eb88abc4..f28d8812 100644 --- a/simple_history/tests/tests/test_utils.py +++ b/simple_history/tests/tests/test_utils.py @@ -6,7 +6,12 @@ import django from django.contrib.auth import get_user_model from django.db import IntegrityError, transaction -from django.test import TestCase, TransactionTestCase, override_settings, tag +from django.test import ( + TestCase, + TransactionTestCase, + override_settings, + skipUnlessDBFeature, +) from django.utils import timezone from simple_history.exceptions import AlternativeManagerError, NotHistoricalModelError @@ -258,6 +263,9 @@ def test_bulk_create_history_with_duplicates_ignore_conflicts(self): self.assertEqual(PollWithUniqueQuestion.objects.count(), 2) self.assertEqual(PollWithUniqueQuestion.history.count(), 2) + @skipUnlessDBFeature( + "supports_update_conflicts", "supports_update_conflicts_with_target" + ) def test_bulk_create_history_with_duplicates_update_conflicts_create_only_field( self, ):