mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 19:43:59 +03:00
Extended test with case of saveing model with blank not null field.
This commit is contained in:
parent
4ce42fb72b
commit
98cc821099
|
@ -1236,6 +1236,8 @@ class BlankFieldTests(TestCase):
|
||||||
def test_create_model_null_field(self):
|
def test_create_model_null_field(self):
|
||||||
serializer = self.model_serializer_class(data={'title': None})
|
serializer = self.model_serializer_class(data={'title': None})
|
||||||
self.assertEqual(serializer.is_valid(), True)
|
self.assertEqual(serializer.is_valid(), True)
|
||||||
|
serializer.save()
|
||||||
|
self.assertTrue(serializer.object.pk is not None)
|
||||||
|
|
||||||
def test_create_not_blank_field(self):
|
def test_create_not_blank_field(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user