mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 13:54:47 +03:00
Update unit tests to exhibit problem
Exhibits the problem that occurs when a model has a one-to-one relationship with another model that is itself derived (subclassed) from a third model.
This commit is contained in:
parent
8ac0c0cbea
commit
61dbf89bd5
|
@ -42,15 +42,3 @@ class InheritedModelSerializationTests(TestCase):
|
|||
serializer = DerivedModelSerializer(child)
|
||||
self.assertEqual(set(serializer.data.keys()),
|
||||
set(['name1', 'name2', 'id', 'childassociatedmodel']))
|
||||
|
||||
def test_data_is_valid_without_parent_ptr(self):
|
||||
"""
|
||||
Assert that the pointer to the parent table is not a required field
|
||||
for input data
|
||||
"""
|
||||
data = {
|
||||
'name1': 'parent name',
|
||||
'name2': 'child name',
|
||||
}
|
||||
serializer = DerivedModelSerializer(data=data)
|
||||
self.assertEqual(serializer.is_valid(), True)
|
||||
|
|
Loading…
Reference in New Issue
Block a user