changeset 4775:0a0387a9eb1e

Groups2009: BackendManager does not require request object in __init__
author Dmitrijs Milajevs <dimazest@gmail.com>
date Sun, 31 May 2009 21:17:49 +0200
parents fb0cce9e8621
children 3f9147c23d9c a7a763c042f0
files MoinMoin/groups/__init__.py MoinMoin/groups/_tests/test_backend_manager.py MoinMoin/groups/_tests/test_group_manager.py MoinMoin/groups/_tests/test_group_manager_acl.py
diffstat 4 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/groups/__init__.py	Sun May 31 21:17:34 2009 +0200
+++ b/MoinMoin/groups/__init__.py	Sun May 31 21:17:49 2009 +0200
@@ -16,7 +16,7 @@
     group name. It provides access to groups of specific backend.
     """
 
-    def __init__(self, request, backend, mapper_to_backend=lambda x: x, mapper_from_backend=lambda x: x):
+    def __init__(self, backend, mapper_to_backend=lambda x: x, mapper_from_backend=lambda x: x):
         """
         Creates backend manager object.
 
--- a/MoinMoin/groups/_tests/test_backend_manager.py	Sun May 31 21:17:34 2009 +0200
+++ b/MoinMoin/groups/_tests/test_backend_manager.py	Sun May 31 21:17:49 2009 +0200
@@ -26,8 +26,7 @@
                   u'EditorGroup': self.editor_group,
                   u'FruitGroup': self.fruit_group}
 
-        self.group_backend = BackendManager(request=self.request,
-                                            backend=groups)
+        self.group_backend = BackendManager(backend=groups)
 
     def test_getitem(self):
         """
@@ -92,8 +91,7 @@
         # Add "Group" postfix for every group name received from a backend
         mapper_from_backend = lambda group_name: "%sGroup" % group_name
 
-        self.group_backend = BackendManager(request=self.request,
-                                            backend=groups,
+        self.group_backend = BackendManager(backend=groups,
                                             mapper_to_backend=mapper_to_backend,
                                             mapper_from_backend=mapper_from_backend)
 
--- a/MoinMoin/groups/_tests/test_group_manager.py	Sun May 31 21:17:34 2009 +0200
+++ b/MoinMoin/groups/_tests/test_group_manager.py	Sun May 31 21:17:49 2009 +0200
@@ -41,8 +41,8 @@
                                  # first_backend and second_backend.
                                  u'AdminGroup': second_admin_group}
         def group_manager_init(self, request):
-            return GroupManager(backends=[BackendManager(request, self.first_backend_groups),
-                                          BackendManager(request, self.second_backend_groups)])
+            return GroupManager(backends=[BackendManager(backend=self.first_backend_groups),
+                                          BackendManager(backend=self.second_backend_groups)])
 
     def setup_method(self, method):
         self.groups = self.request.groups
--- a/MoinMoin/groups/_tests/test_group_manager_acl.py	Sun May 31 21:17:34 2009 +0200
+++ b/MoinMoin/groups/_tests/test_group_manager_acl.py	Sun May 31 21:17:49 2009 +0200
@@ -22,7 +22,7 @@
             groups = {u'FirstGroup': frozenset([u"ExampleUser", u"SecondUser", u"JoeDoe"]),
                       u'SecondGroup': frozenset([u"ExampleUser", u"ThirdUser"])}
 
-            return GroupManager(backends=[BackendManager(request=request, backend=groups)])
+            return GroupManager(backends=[BackendManager(backend=groups)])
 
     def testConfigBackendAcl(self):
         """