summaryrefslogtreecommitdiff
path: root/tests/generic_relations_regress/tests.py
diff options
context:
space:
mode:
authorsarahboyce <sarahvboyce95@gmail.com>2022-04-19 13:21:23 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-04-21 10:12:28 +0200
commitcd4da34fc1f1df08f593e461b2f670bfd61d0d2f (patch)
tree315cd3eba3bfee07fca59a1cff6405ac6923a379 /tests/generic_relations_regress/tests.py
parent1ed8ca43f61138b8f8d6f92106c27060753ed4e7 (diff)
Fixed #33004 -- Made saving objects with unsaved GenericForeignKey raise ValueError.
This aligns to the behaviour of OneToOneField and ForeignKey fields. Thanks Jonny Park for the initial patch.
Diffstat (limited to 'tests/generic_relations_regress/tests.py')
-rw-r--r--tests/generic_relations_regress/tests.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/tests/generic_relations_regress/tests.py b/tests/generic_relations_regress/tests.py
index 16705131a7..6c708fefbb 100644
--- a/tests/generic_relations_regress/tests.py
+++ b/tests/generic_relations_regress/tests.py
@@ -1,4 +1,3 @@
-from django.db import IntegrityError
from django.db.models import ProtectedError, Q, Sum
from django.forms.models import modelform_factory
from django.test import TestCase, skipIfDBFeature
@@ -15,7 +14,6 @@ from .models import (
Contact,
Content,
D,
- Developer,
Guild,
HasLinkThing,
Link,
@@ -140,14 +138,6 @@ class GenericRelationTests(TestCase):
self.assertEqual(count_places(p1), 1)
self.assertEqual(count_places(p2), 1)
- def test_target_model_is_unsaved(self):
- """Test related to #13085"""
- # Fails with another, ORM-level error
- dev1 = Developer(name="Joe")
- note = Note(note="Deserves promotion", content_object=dev1)
- with self.assertRaises(IntegrityError):
- note.save()
-
def test_target_model_len_zero(self):
"""
Saving a model with a GenericForeignKey to a model instance whose