Commits

Luke Plant committed 878ece0

Better test and proper fix

Comments (0)

Files changed (2)

semanticeditor/tests.py

                               "<ul><li>A test</li></ul>")
 
     def test_duplicate_ids(self):
-        self.assertEqualClean('<p id="p_1">test</p><p id="p_1">test 2</p>',
-                              '<p id="p_1">test</p><p>test 2</p>')
+        self.assertEqualClean('<p id="p_1">test</p><p id="p_1">test 2</p>' +
+                              '<ul id="ul_1">test</ul><ul id="ul_1">test 2</p>',
+                              '<p id="p_1">test</p><p>test 2</p>' +
+                              '<ul id="ul_1">test</ul><ul>test 2</ul>')
+

semanticeditor/utils/presentation.py

     for i in set(ids):
         for j, node in enumerate(doc('#' + i)):
             if (j > 0): # skip the first one
-                del n.attrib['id']
+                del node.attrib['id']
 
     for x in ['p + br', 'p:empty']:
         doc(x).remove()