aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_relations.py
diff options
context:
space:
mode:
authorTom Christie2014-10-31 16:40:06 +0000
committerTom Christie2014-10-31 16:40:06 +0000
commit65a0d083d63d4f22a2e985a847284ad4f4a3d572 (patch)
treef0030c8c1a7e4d2f578898191ebebdafc7255ba7 /tests/test_relations.py
parent5e1ed0aa9578be360261d5ba8b89aec959e948c8 (diff)
parent140f8620aea44daa368b244d96c68377716fac7e (diff)
downloaddjango-rest-framework-65a0d083d63d4f22a2e985a847284ad4f4a3d572.tar.bz2
Merge pull request #1963 from carljm/lazy-fields
Set up serializer fields lazily on-demand.
Diffstat (limited to 'tests/test_relations.py')
-rw-r--r--tests/test_relations.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_relations.py b/tests/test_relations.py
index bc1db69f..501a9208 100644
--- a/tests/test_relations.py
+++ b/tests/test_relations.py
@@ -102,7 +102,7 @@ class RelatedFieldSourceTests(TestCase):
self.assertEqual(value, ['BlogPost object'])
# Regression for #1129
- def test_exception_for_incorect_fk(self):
+ def test_exception_for_incorrect_fk(self):
"""
Check that the exception message are correct if the source field
doesn't exist.
@@ -123,8 +123,9 @@ class RelatedFieldSourceTests(TestCase):
(serializers.ModelSerializer,),
attrs
)
+ serializer = TestSerializer(data={'name': 'foo'})
with self.assertRaises(AttributeError):
- TestSerializer(data={'name': 'foo'})
+ serializer.fields
@unittest.skipIf(get_version() < '1.6.0', 'Upstream behaviour changed in v1.6')