aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_relations.py
diff options
context:
space:
mode:
authorTom Christie2014-09-25 11:40:32 +0100
committerTom Christie2014-09-25 11:40:32 +0100
commit64632da3718f501cb8174243385d38b547c2fefd (patch)
treecb1f7eba968fe61a302639008ba6c7e32678c329 /tests/test_relations.py
parentb22c9602fa0f717b688fdb35e4f6f42c189af3f3 (diff)
downloaddjango-rest-framework-64632da3718f501cb8174243385d38b547c2fefd.tar.bz2
Clean up bind - no longer needs to be called multiple times in nested fields
Diffstat (limited to 'tests/test_relations.py')
-rw-r--r--tests/test_relations.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_relations.py b/tests/test_relations.py
index c29618ce..2d11672b 100644
--- a/tests/test_relations.py
+++ b/tests/test_relations.py
@@ -51,7 +51,7 @@ class TestHyperlinkedIdentityField(APISimpleTestCase):
self.instance = MockObject(pk=1, name='foo')
self.field = serializers.HyperlinkedIdentityField(view_name='example')
self.field.reverse = mock_reverse
- self.field.context = {'request': True}
+ self.field._context = {'request': True}
def test_representation(self):
representation = self.field.to_representation(self.instance)
@@ -62,7 +62,7 @@ class TestHyperlinkedIdentityField(APISimpleTestCase):
assert representation is None
def test_representation_with_format(self):
- self.field.context['format'] = 'xml'
+ self.field._context['format'] = 'xml'
representation = self.field.to_representation(self.instance)
assert representation == 'http://example.org/example/1.xml/'
@@ -91,14 +91,14 @@ class TestHyperlinkedIdentityFieldWithFormat(APISimpleTestCase):
self.instance = MockObject(pk=1, name='foo')
self.field = serializers.HyperlinkedIdentityField(view_name='example', format='json')
self.field.reverse = mock_reverse
- self.field.context = {'request': True}
+ self.field._context = {'request': True}
def test_representation(self):
representation = self.field.to_representation(self.instance)
assert representation == 'http://example.org/example/1/'
def test_representation_with_format(self):
- self.field.context['format'] = 'xml'
+ self.field._context['format'] = 'xml'
representation = self.field.to_representation(self.instance)
assert representation == 'http://example.org/example/1.json/'