mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-11 12:17:24 +03:00
Regression test for #1330 (Coerce None to '')
This commit is contained in:
parent
52686420f4
commit
46f5c62530
|
@ -1124,6 +1124,20 @@ class BlankFieldTests(TestCase):
|
|||
serializer = self.model_serializer_class(data={})
|
||||
self.assertEqual(serializer.is_valid(), True)
|
||||
|
||||
def test_create_model_null_field_save(self):
|
||||
"""
|
||||
Regression test for #1330.
|
||||
|
||||
https://github.com/tomchristie/django-rest-framework/pull/1330
|
||||
"""
|
||||
serializer = self.model_serializer_class(data={'title': None})
|
||||
self.assertEqual(serializer.is_valid(), True)
|
||||
|
||||
try:
|
||||
serializer.save()
|
||||
except Exception:
|
||||
self.fail('Exception raised on save() after validation passes')
|
||||
|
||||
|
||||
#test for issue #460
|
||||
class SerializerPickleTests(TestCase):
|
||||
|
|
Loading…
Reference in New Issue
Block a user