Added unit tests for error stanzas. Corrected error in deleting conditions.

This commit is contained in:
Lance Stout
2010-07-29 23:55:13 -04:00
parent a96a046e27
commit 1da3e5b35e
2 changed files with 59 additions and 1 deletions

View File

@@ -108,7 +108,9 @@ class Error(ElementBase):
"""Remove the condition element."""
for child in self.xml.getchildren():
if "{%s}" % self.condition_ns in child.tag:
self.xml.remove(child)
tag = child.tag.split('}', 1)[-1]
if tag in self.conditions:
self.xml.remove(child)
return self
def getText(self):