devtools/fake.py
changeset 7360 dbff01dd3c3c
parent 7356 73d7863d97c1
child 7398 26695dd703d8
--- a/devtools/fake.py	Tue May 10 18:53:30 2011 +0200
+++ b/devtools/fake.py	Wed May 11 09:38:44 2011 +0200
@@ -139,9 +139,13 @@
 
 class FakeSession(RequestSessionBase):
 
-    def __init__(self, repo=None, user=None):
+    def __init__(self, repo=None, user=None, vreg=None):
         self.repo = repo
-        self.vreg = getattr(self.repo, 'vreg', CubicWebVRegistry(FakeConfig(), initlog=False))
+        if vreg is None:
+            vreg = getattr(self.repo, 'vreg', None)
+        if vreg is None:
+            vreg = CubicWebVRegistry(FakeConfig(), initlog=False)
+        self.vreg = vreg
         self.pool = FakePool()
         self.user = user or FakeUser()
         self.is_internal_session = False