changeset 901:5377e1c6a10f storage-ng

fix group item rename test, remove item copy test (not implemented)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 28 Sep 2011 23:37:29 +0200
parents 24d7fb1b59c9
children 7b8c2d36a291
files MoinMoin/datastruct/backends/_tests/test_wiki_groups.py
diffstat 1 files changed, 6 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py	Tue Sep 27 23:15:54 2011 +0200
+++ b/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py	Wed Sep 28 23:37:29 2011 +0200
@@ -17,7 +17,7 @@
 
 from MoinMoin.datastruct.backends._tests import GroupsBackendTest
 from MoinMoin.datastruct import GroupDoesNotExistError
-from MoinMoin.config import USERGROUP
+from MoinMoin.config import NAME, USERGROUP
 from MoinMoin.security import AccessControlList
 from MoinMoin.user import User
 from MoinMoin._tests import become_trusted, create_random_string_list, update_item
@@ -41,28 +41,12 @@
         """
         become_trusted()
         item = update_item(u'SomeGroup', 0, {USERGROUP: ["ExampleUser"]}, DATA)
-        item.rename(u'AnotherGroup')
-
-        result = u'ExampleUser' in flaskg.groups[u'AnotherGroup']
-        assert result
-
-        pytest.raises(GroupDoesNotExistError, lambda: flaskg.groups[u'SomeGroup'])
+        assert u'ExampleUser' in flaskg.groups[u'SomeGroup']
+        pytest.raises(GroupDoesNotExistError, lambda: flaskg.groups[u'AnotherGroup'])
 
-    def test_copy_group_item(self):
-        """
-        Tests copying a group item.
-        """
-        pytest.skip("item.copy() is not finished")
-
-        become_trusted()
-        item = update_item(u'SomeGroup', 0,  {USERGROUP: ["ExampleUser"]}, DATA)
-        item.copy(u'SomeOtherGroup')
-
-        result = u'ExampleUser' in flaskg.groups[u'SomeOtherGroup']
-        assert result
-
-        result = u'ExampleUser' in flaskg.groups[u'SomeGroup']
-        assert result
+        item = update_item(u'SomeGroup', 0, {NAME: u'AnotherGroup', USERGROUP: ["ExampleUser"]}, DATA)
+        assert u'ExampleUser' in flaskg.groups[u'AnotherGroup']
+        pytest.raises(GroupDoesNotExistError, lambda: flaskg.groups[u'SomeGroup'])
 
     def test_appending_group_item(self):
         """