Example #1
0
 def test_with_children(self):
     fields = {"hello": "there"}
     children_tags = ["bar", "baz"]
     children = [Element(child_tag) for child_tag in children_tags]
     request_data = make_request_data("foo", fields, children)
     root = XML(request_data)
     self.assertEqual("foo", root.tag)
     self.assertItemsEqual(children_tags, (e.tag for e in root))
Example #2
0
 def test_with_children(self):
     fields = {'hello': 'there'}
     children_tags = ['bar', 'baz']
     children = [Element(child_tag) for child_tag in children_tags]
     request_data = make_request_data('foo', fields, children)
     root = XML(request_data)
     self.assertEqual('foo', root.tag)
     self.assertItemsEqual(children_tags, (e.tag for e in root))
Example #3
0
 def test_no_fields(self):
     request_data = make_request_data("foo")
     root = XML(request_data)
     self.assertEqual("foo", root.tag)
Example #4
0
 def test_no_children(self):
     fields = {"hello": "there"}
     request_data = make_request_data("foo", fields)
     root = XML(request_data)
     self.assertEqual("foo", root.tag)
     self.assertEqual("there", root.get("hello"))
Example #5
0
 def test_no_children(self):
     fields = {'hello': 'there'}
     request_data = make_request_data('foo', fields)
     root = XML(request_data)
     self.assertEqual('foo', root.tag)
     self.assertEqual('there', root.get('hello'))