1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Refs #36580 -- Added coverage for excluding ForeignObject from constraint validation.

This commit is contained in:
SaJH
2025-09-15 19:55:20 -04:00
committed by Jacob Walls
parent 82b3b84a78
commit 308f674e6d
3 changed files with 29 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ from .models import (
ArticleTag,
ArticleTranslation,
Country,
CustomerTab,
Friendship,
Group,
Membership,
@@ -767,3 +768,10 @@ class TestCachedPathInfo(TestCase):
foreign_object_restored = pickle.loads(pickle.dumps(foreign_object))
self.assertIn("path_infos", foreign_object_restored.__dict__)
self.assertIn("reverse_path_infos", foreign_object_restored.__dict__)
class ForeignObjectModelValidationTests(TestCase):
@skipUnlessDBFeature("supports_table_check_constraints")
def test_validate_constraints_excluding_foreign_object(self):
customer_tab = CustomerTab(customer_id=150)
customer_tab.validate_constraints(exclude={"customer"})