  
  from django.core.cache import cache
  from django.test import TestCase
  from django.test.client import RequestFactory
  
  from rest_framework import status, permissions
  from rest_framework.compat import yaml, patterns, url, include
  from rest_framework.response import Response
  from rest_framework.views import APIView
  from rest_framework.renderers import BaseRenderer, JSONRenderer, YAMLRenderer, \
 
</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 import pickle
import re

 </s> add from decimal import Decimal </s> remove from rest_framework.compat import yaml, ETParseError, ET_XMLParser
 </s> add from rest_framework.compat import yaml, etree </s> remove from xml.etree import ElementTree as ET
from xml.parsers.expat import ExpatError
 </s> add 
from django.utils import unittest
  
  from django.core.cache import cache
  from django.test import TestCase
  from django.test.client import RequestFactory
from django.utils import unittest
  from rest_framework import status, permissions
  from rest_framework.compat import yaml, patterns, url, include
  from rest_framework.response import Response
  from rest_framework.views import APIView
  from rest_framework.renderers import BaseRenderer, JSONRenderer, YAMLRenderer, \
keep keep keep keep 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