  import pickle
  import re
  
  from django.core.cache import cache
  from django.test import TestCase
  from django.test.client import RequestFactory
  
  from rest_framework import status, permissions
 
</s> remove 
 </s> add from django.utils import unittest </s> remove from rest_framework.compat import yaml, patterns, url, include
 </s> add from rest_framework.compat import yaml, etree, patterns, url, include </s> remove from decimal import Decimal
 </s> add import pickle
import re </s> remove from rest_framework.compat import yaml, ETParseError, ET_XMLParser
 </s> add from rest_framework.compat import yaml, etree
from decimal import Decimal
from decimal import Decimal
from decimal import Decimal
from decimal import Decimal
  from django.core.cache import cache
  from django.test import TestCase
  from django.test.client import RequestFactory
  
  from rest_framework import status, permissions
replace replace replace keep keep keep keep keep
 defusedxml for security fix.

As per:
http://blog.python.org/2013/02/announcing-defusedxml-fixes-for-xml.html 
rest_framework/tests/renderers.py