mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 05:04:31 +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={})
|
serializer = self.model_serializer_class(data={})
|
||||||
self.assertEqual(serializer.is_valid(), True)
|
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
|
#test for issue #460
|
||||||
class SerializerPickleTests(TestCase):
|
class SerializerPickleTests(TestCase):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user