aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_serializer.py
diff options
context:
space:
mode:
authorCarl Meyer2014-10-16 12:16:13 -0600
committerCarl Meyer2014-10-17 09:50:57 -0600
commit140f8620aea44daa368b244d96c68377716fac7e (patch)
treea9be3c9063dcf9e2d9705ce652b7183eac523178 /tests/test_serializer.py
parent34a7a48c1d0ee72f93aa9ff646192269a0451fd5 (diff)
downloaddjango-rest-framework-140f8620aea44daa368b244d96c68377716fac7e.tar.bz2
Set up serializer fields lazily on-demand.
This avoids AppRegistryNotReady problems in Django 1.7 with nested serializers, which are instantiated at import time, possibly before Django's app registry is fully populated.
Diffstat (limited to 'tests/test_serializer.py')
-rw-r--r--tests/test_serializer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_serializer.py b/tests/test_serializer.py
index 90f37cf2..e72b723f 100644
--- a/tests/test_serializer.py
+++ b/tests/test_serializer.py
@@ -327,7 +327,9 @@ class BasicTests(TestCase):
"""
Regression test for #652.
"""
- self.assertRaises(AssertionError, PersonSerializerInvalidReadOnly, [])
+ serializer = PersonSerializerInvalidReadOnly()
+ with self.assertRaises(AssertionError):
+ serializer.fields
def test_serializer_data_is_cleared_on_save(self):
"""