Commits

ana-balica  committed d6d3ad2 Merge

Merged thomaswaldmann/moin-2.0 into default

  • Participants
  • Parent commits da5db71, 8370552

Comments (0)

Files changed (2)

File MoinMoin/items/__init__.py

 
     def modify(self, meta, data, comment=u'', contenttype_guessed=None, **update_meta):
         meta = dict(meta)  # we may get a read-only dict-like, copy it
+        # get rid of None values
+        update_meta = {key:value for key, value in update_meta.items() if value is not None}
         meta.update(update_meta)
         return self._save(meta, data, contenttype_guessed=contenttype_guessed, comment=comment)
 

File MoinMoin/items/_tests/test_Item.py

         update_meta = {
             'another_test_key': 'updated_test_value',
             'new_test_key': 'new_test_value',
+            'none_test_key': None,
         }
         item.modify(another_meta, another_data, **update_meta)
         item = Item.create(name)
         assert item.meta['test_key'] == another_meta['test_key']
         assert item.meta['another_test_key'] == update_meta['another_test_key']
         assert item.meta['new_test_key'] == update_meta['new_test_key']
+        assert 'none_test_key' not in item.meta
 
 
 coverage_modules = ['MoinMoin.items']