              (data, files) = parser.parse(StringIO(content))
              self.assertEquals(obj, data)
  
  
  class XMLRendererTestCase(TestCase):
      """
      Tests specific to the XML Renderer
      """
  
      def test_render_string(self):
          """
          Test XML rendering.
          """
          renderer = XMLRenderer(None)
          content = renderer.render({'field': 'astring'}, 'application/xml')
          self.assertXMLContains(content, '<field>astring</field>')
  
      def test_render_integer(self):
          """
          Test XML rendering.
          """
          renderer = XMLRenderer(None)
          content = renderer.render({'field': 111}, 'application/xml')
          self.assertXMLContains(content, '<field>111</field>')
  
      def test_render_datetime(self):
          """
          Test XML rendering.
          """
          renderer = XMLRenderer(None)
          content = renderer.render({
              'field': datetime.datetime(2011, 12, 25, 12, 45, 00)
          }, 'application/xml')
          self.assertXMLContains(content, '<field>2011-12-25 12:45:00</field>')
  
      def test_render_float(self):
          """
          Test XML rendering.
          """
          renderer = XMLRenderer(None)
          content = renderer.render({'field': 123.4}, 'application/xml')
          self.assertXMLContains(content, '<field>123.4</field>')
  
      def test_render_decimal(self):
          """
          Test XML rendering.
          """
          renderer = XMLRenderer(None)
          content = renderer.render({'field': Decimal('111.2')}, 'application/xml')
          self.assertXMLContains(content, '<field>111.2</field>')
  
      def test_render_none(self):
          """
          Test XML rendering.
          """
          renderer = XMLRenderer(None)
          content = renderer.render({'field': None}, 'application/xml')
          self.assertXMLContains(content, '<field></field>')
  
      def assertXMLContains(self, xml, string):
          self.assertTrue(xml.startswith('<?xml version="1.0" encoding="utf-8"?>\n<root>'))
          self.assertTrue(xml.endswith('</root>'))
          self.assertTrue(string in xml, '%r not in %r' % (string, xml))
  
  class HTMLView(View):
      renderers = (DocumentingHTMLRenderer)
  
      def get(self, request, **kwargs):
          return 'text' 
  
  urlpatterns += patterns('',
      url(r'^/html$', HTMLView.as_view()),
  )
  
  class Issue122Tests(TestCase):
 
</s> remove         self.input = StringIO(
 </s> add         self._input = StringIO( </s> remove         (data, files) = parser.parse(self.input)
        self.assertEqual(data, self.data)
 </s> add         (data, files) = parser.parse(self._input)
        self.assertEqual(data, self._data)

    def test_complex_data_parse(self):
        parser = XMLParser(None)
        (data, files) = parser.parse(self._complex_data_input)
        self.assertEqual(data, self._complex_data) </s> remove 		
 </s> add         self._complex_data_input = StringIO(
            '<?xml version="1.0" encoding="utf-8"?>'
            '<root>'
            '<creation_date>2011-12-25 12:45:00</creation_date>'
            '<sub_data_list>'
            '<list-item><sub_id>1</sub_id><sub_name>first</sub_name></list-item>'
            '<list-item><sub_id>2</sub_id><sub_name>second</sub_name></list-item>'
            '</sub_data_list>'
            '<name>name</name>'
            '</root>'
        )    
        self._complex_data = {
            "creation_date": datetime.datetime(2011, 12, 25, 12, 45, 00), 
            "name": "name", 
            "sub_data_list": [
                {
                    "sub_id": 1, 
                    "sub_name": "first"
                }, 
                {
                    "sub_id": 2, 
                    "sub_name": "second"
                }
            ]
        }                               

              (data, files) = parser.parse(StringIO(content))
              self.assertEquals(obj, data)
  
  


































































  urlpatterns += patterns('',
      url(r'^/html$', HTMLView.as_view()),
  )
  
  class Issue122Tests(TestCase):
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 split renderer and parser complex data test case 
djangorestframework/tests/renderers.py