mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Save objects before assigning them in InheritedModelSerializationTests; Django 1.8 now throws an error when assigning unsaved objects to Foreign Key, GenericForeignKey, and OneToOneFields
This commit is contained in:
parent
a82a4d0a09
commit
b5128ca574
|
@ -48,8 +48,8 @@ class InheritedModelSerializationTests(TestCase):
|
|||
Assert that a model with a onetoone field that is the primary key is
|
||||
not treated like a derived model
|
||||
"""
|
||||
parent = ParentModel(name1='parent name')
|
||||
associate = AssociatedModel(name='hello', ref=parent)
|
||||
parent = ParentModel.objects.create(name1='parent name')
|
||||
associate = AssociatedModel.objects.create(name='hello', ref=parent)
|
||||
serializer = AssociatedModelSerializer(associate)
|
||||
self.assertEqual(set(serializer.data.keys()),
|
||||
set(['name', 'ref']))
|
||||
|
|
Loading…
Reference in New Issue
Block a user