                  return self._dict.__iter__()
              def __len__(self):
                  return self._dict.__len__()
  
          x = Dict()
          x['key'] = 'string value'
          x[2] = 3
          ret = JSONRenderer().render(x)
 
</s> remove         self.assertEquals(json.loads(ret), {'key': 'string value', '2': 3})
            
 </s> add         data = json.loads(ret.decode('utf-8'))
        self.assertEquals(data, {'key': 'string value', '2': 3})     </s> remove     def test_render_userdict_obj(self):
        class DictLike(UserDict.DictMixin):
            def __init__(self):
                self._dict = dict()
            def __getitem__(self, key):
                return self._dict.__getitem__(key)
            def __setitem__(self, key, value):
                return self._dict.__setitem__(key, value)
            def __delitem__(self, key):
                return self._dict.__delitem__(key)
            def keys(self):
                return self._dict.keys()
        x = DictLike()
        x['a'] = 1
        x['b'] = "string value"
        ret = JSONRenderer().render(x)
        self.assertEquals(json.loads(ret), {'a': 1, 'b': 'string value'})

 </s> add  </s> remove         class Dict(collections.MutableMapping):
 </s> add         class Dict(MutableMapping): </s> remove import UserDict
import collections
import json
 </s> add 
            def keys(self):
                return self._dict.keys()
                  return self._dict.__iter__()
              def __len__(self):
                  return self._dict.__len__()
            def keys(self):
                return self._dict.keys()
  
          x = Dict()
          x['key'] = 'string value'
          x[2] = 3
          ret = JSONRenderer().render(x)
keep keep add keep keep keep keep keep
 Fix compat issues for #1231 
rest_framework/tests/test_renderers.py