Changeset 86:f4aa0d507bc8


Ignore:
Timestamp:
Jan 10, 2010, 12:43:48 PM (12 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Don't set an explicit namespace on wokkel.pubsub.Item.

Before this change, wokkel.pubsub.Item could not be used for constructing
notifications, as those are in another namespace. This makes sure that items
will always have the correct namespace, inherited from their ancestors.

Location:
wokkel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wokkel/pubsub.py

    r84 r86  
    175175        """
    176176
    177         domish.Element.__init__(self, (NS_PUBSUB, 'item'))
     177        domish.Element.__init__(self, (None, 'item'))
    178178        if id is not None:
    179179            self['id'] = id
  • wokkel/test/test_pubsub.py

    r84 r86  
    437437        child = children[0]
    438438        self.assertEquals('test', child['node'])
    439         items = list(domish.generateElementsQNamed(child.children,
    440                                                    'item', NS_PUBSUB))
     439
     440        items = []
     441        for element in child.elements():
     442            if element.name == 'item' and element.uri in (NS_PUBSUB, None):
     443                items.append(element)
     444
    441445        self.assertEquals(1, len(items))
    442446        self.assertIdentical(item, items[0])
     
    29072911            self.assertTrue(domish.IElement.providedBy(item))
    29082912            self.assertEqual('item', item.name)
    2909             self.assertEqual(NS_PUBSUB, item.uri)
     2913            self.assertIn(item.uri, (NS_PUBSUB, None))
    29102914            self.assertEqual('current', item['id'])
    29112915
Note: See TracChangeset for help on using the changeset viewer.