changeset 2409:7c32a0f0d570

Forgotten file (test_packages.py)
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Mon, 16 Jul 2007 15:24:48 +0200
parents ca02fd95fe59
children a3410c72b839
files MoinMoin/_tests/test_packages.py
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_packages.py	Mon Jul 16 12:38:00 2007 +0200
+++ b/MoinMoin/_tests/test_packages.py	Mon Jul 16 15:24:48 2007 +0200
@@ -12,7 +12,7 @@
 from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
 from MoinMoin.packages import Package, ScriptEngine, MOIN_PACKAGE_FILE, packLine, unpackLine
-
+from MoinMoin._tests.common import gain_superuser_rights
 
 
 class DebugPackage(Package, ScriptEngine):
@@ -62,15 +62,9 @@
 DeletePage|FooPage|Test ...
 """).installPackage()
 
-    def gain_superuser_rights(self):
-        self.request.user.name = "SuperUserName"
-        self.request.user.valid = 1
-        self.request.user.may.name = self.request.user.name
-        self.request.cfg.superuser.append(self.request.user.name)
-        self.request.user.auth_method = self.request.cfg.trusted_auth_methods[0]
 
     def testBasicPackageThings(self):
-        self.gain_superuser_rights()
+        gain_superuser_rights(self.request)
         myPackage = DebugPackage(self.request, 'test')
         myPackage.installPackage()
         assert myPackage.msg == u'foo\nFooPage added \n'