def test_namespace(self): # raw xml that goes in with a ns prefix should come out with one # (even though it's meaningless without the ns declaration) # it's lousy to do this with string tests, but ET/Expat really # doesn't want to load xml with unbound prefixes items = [fac.ActivityFactory.build(raw_xml=u"<t:test />")] ser_data = "".join(serialize.xml(TestWrapper(items, 0, 0, 0))) self.assertIn("t:test", ser_data)
def test_namespace(self): # raw xml that goes in with a ns prefix should come out with one # (even though it's meaningless without the ns declaration) # it's lousy to do this with string tests, but ET/Expat really # doesn't want to load xml with unbound prefixes items = [create_activity(parent__raw_xml=u"<t:test />")] ser_data = serialize.xml(items) self.assertIn("t:test", ser_data)
def test_results_count(self): data =[ fac.ActivityFactory.build(raw_xml=u"<test />") ] ser_data = "".join(serialize.xml(TestWrapper(data, 1, 0, 0))) result = ET.fromstring(ser_data) self.assertEquals("1", result[1][0][0].text)
def process(self, items): pagination = TestWrapper(items, 0, 0, 0) return ET.fromstring(u"".join(serialize.xml(pagination)).encode("utf-8"))
def test_results_count(self): data = [fac.ActivityFactory.build(raw_xml=u"<test />")] ser_data = "".join(serialize.xml(TestWrapper(data, 1, 0, 0))) result = ET.fromstring(ser_data) self.assertEquals("1", result[1][0][0].text)
def process(self, items): pagination = TestWrapper(items, 0, 0, 0) return ET.fromstring(u"".join( serialize.xml(pagination)).encode("utf-8"))
def process(self, items): return ET.fromstring(serialize.xml(items).encode("utf-8"))