Commits

Thomas Waldmann  committed 66c5f8b

remove count_items (unused, uses deprecated code)

  • Participants
  • Parent commits 5c60754
  • Branches pytest2

Comments (0)

Files changed (2)

File MoinMoin/items/__init__.py

 
     list_items = search_items  # just for cosmetics
 
-    def count_items(self, term=None):
-        """
-        Return item count for matching items. See search_items() for details.
-        """
-        count = 0
-        # we intentionally use a loop to avoid creating a list with all item objects:
-        for item in self.list_items(term):
-            count += 1
-        return count
-
     def get_index(self):
         """ create an index of sub items of this item """
         if self.name:

File MoinMoin/items/_tests/test_Item.py

         with pytest.raises(KeyError):
             item.meta['test_key']
 
-    def test_count_items(self):
-        name = u'Test_Item'
-        contenttype = u'text/plain;charset=utf-8'
-        meta = {CONTENTTYPE: contenttype}
-        item = Item.create(name)
-        item._save(meta)
-        item = Item.create(name)
-        result1 = item.count_items()
-        assert result1 == 1
-        # add another item
-        new_name = u'New_Item'
-        meta = {CONTENTTYPE: contenttype}
-        item = Item.create(new_name)
-        item._save(meta)
-        item = Item.create(new_name)
-        result2 = item.count_items()
-        assert result2 == 2
 
 class TestBinary(object):
     """ Test for arbitrary binary items """