diff options
| author | David Muller | 2015-01-18 15:19:11 -0800 |
|---|---|---|
| committer | David Muller | 2015-01-18 15:19:11 -0800 |
| commit | b5128ca574d03ea590a198b04043142a3fc7163e (patch) | |
| tree | b5cc4b21c0fc8fbc7bb4fc08af1147d1d20886a0 | |
| parent | a82a4d0a099eea74832ce3d8de376e4dbeb4b266 (diff) | |
| download | django-rest-framework-b5128ca574d03ea590a198b04043142a3fc7163e.tar.bz2 | |
Save objects before assigning them in InheritedModelSerializationTests; Django 1.8 now throws an error when assigning unsaved objects to Foreign Key, GenericForeignKey, and OneToOneFields
| -rw-r--r-- | tests/test_multitable_inheritance.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_multitable_inheritance.py b/tests/test_multitable_inheritance.py index e1b40cc7..15627e1d 100644 --- a/tests/test_multitable_inheritance.py +++ b/tests/test_multitable_inheritance.py @@ -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'])) |
