mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Regression test for #1072
This commit is contained in:
parent
f8101114d1
commit
a15cda4be4
|
@ -283,6 +283,15 @@ class PKForeignKeyTests(TestCase):
|
|||
self.assertFalse(serializer.is_valid())
|
||||
self.assertEqual(serializer.errors, {'target': ['This field is required.']})
|
||||
|
||||
def test_foreign_key_with_empty(self):
|
||||
"""
|
||||
Regression test for #1072
|
||||
|
||||
https://github.com/tomchristie/django-rest-framework/issues/1072
|
||||
"""
|
||||
serializer = NullableForeignKeySourceSerializer()
|
||||
self.assertEqual(serializer.data['target'], None)
|
||||
|
||||
|
||||
class PKNullableForeignKeyTests(TestCase):
|
||||
def setUp(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user