aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/parsers.py
diff options
context:
space:
mode:
authorTom Christie2013-02-22 13:17:22 +0000
committerTom Christie2013-02-22 13:17:22 +0000
commitdcee027fa97f015ff3b87f0fd72b7995cdd6e155 (patch)
tree676f581fe03c4a3e01d479756c590f75dc4aab4a /rest_framework/tests/parsers.py
parentb261515afa18a5d2a38d729b174bbd99ddee14ac (diff)
downloaddjango-rest-framework-dcee027fa97f015ff3b87f0fd72b7995cdd6e155.tar.bz2
defusedxml for security fix.
As per: http://blog.python.org/2013/02/announcing-defusedxml-fixes-for-xml.html
Diffstat (limited to 'rest_framework/tests/parsers.py')
-rw-r--r--rest_framework/tests/parsers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/rest_framework/tests/parsers.py b/rest_framework/tests/parsers.py
index c03df08f..539c5b44 100644
--- a/rest_framework/tests/parsers.py
+++ b/rest_framework/tests/parsers.py
@@ -2,6 +2,8 @@ from __future__ import unicode_literals
from rest_framework.compat import StringIO
from django import forms
from django.test import TestCase
+from django.utils import unittest
+from rest_framework.compat import etree
from rest_framework.parsers import FormParser
from rest_framework.parsers import XMLParser
import datetime
@@ -69,11 +71,13 @@ class TestXMLParser(TestCase):
]
}
+ @unittest.skipUnless(etree, 'defusedxml not installed')
def test_parse(self):
parser = XMLParser()
data = parser.parse(self._input)
self.assertEqual(data, self._data)
+ @unittest.skipUnless(etree, 'defusedxml not installed')
def test_complex_data_parse(self):
parser = XMLParser()
data = parser.parse(self._complex_data_input)