changeset 783:66c5f8bdfb2b pytest2

remove count_items (unused, uses deprecated code)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 27 Aug 2011 22:27:44 +0200
parents 5c60754f8d1a
children 22350c783ec5
files MoinMoin/items/__init__.py MoinMoin/items/_tests/test_Item.py
diffstat 2 files changed, 0 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Sat Aug 27 22:10:27 2011 +0200
+++ b/MoinMoin/items/__init__.py	Sat Aug 27 22:27:44 2011 +0200
@@ -543,16 +543,6 @@
 
     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:
--- a/MoinMoin/items/_tests/test_Item.py	Sat Aug 27 22:10:27 2011 +0200
+++ b/MoinMoin/items/_tests/test_Item.py	Sat Aug 27 22:27:44 2011 +0200
@@ -216,23 +216,6 @@
         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 """