summaryrefslogtreecommitdiff
path: root/tests/generic_relations
diff options
context:
space:
mode:
authorZachLiuGIS <zachliugis@gmail.com>2016-02-10 20:46:57 -0500
committerTim Graham <timograham@gmail.com>2016-02-11 10:07:39 -0500
commit04e13c89138d48c20e774a2b6bf06796f73ac0fe (patch)
tree0023c60c24ace9e5dc2a176ffbf0f8c0c10f9c74 /tests/generic_relations
parent353aecbf8c1a8cc6f3985149e2895d49e53dfc1c (diff)
downloaddjango-04e13c89138d48c20e774a2b6bf06796f73ac0fe.tar.gz
Fixed #26179 -- Removed null assignment check for non-nullable foreign key fields.
Diffstat (limited to 'tests/generic_relations')
-rw-r--r--tests/generic_relations/tests.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/generic_relations/tests.py b/tests/generic_relations/tests.py
index 436bb92222..806f8ca91a 100644
--- a/tests/generic_relations/tests.py
+++ b/tests/generic_relations/tests.py
@@ -717,14 +717,11 @@ class ProxyRelatedModelTest(TestCase):
class TestInitWithNoneArgument(SimpleTestCase):
- def test_none_not_allowed(self):
- # TaggedItem requires a content_type, initializing with None should
- # raise a ValueError.
- msg = 'Cannot assign None: "TaggedItem.content_type" does not allow null values'
- with self.assertRaisesMessage(ValueError, msg):
- TaggedItem(content_object=None)
def test_none_allowed(self):
# AllowsNullGFK doesn't require a content_type, so None argument should
# also be allowed.
AllowsNullGFK(content_object=None)
+ # TaggedItem requires a content_type but initializing with None should
+ # be allowed.
+ TaggedItem(content_object=None)