def testDonotHandle(self): dfp = DisallowFilePlugin() req = MockRequest() try: dfp.handle(req, '/some/path/to/datadirectory/edit') self.fail() except IOError, e: self.assertTrue('/some/path/to/datadirectory/edit' in str(e))
def testHandle(self): # The handle call should not throw an exception. # If it does, then something is wrong. dfp = DisallowFilePlugin() req = MockRequest() dfp.handle(req, '/zomaariets') # "edit" is a special page that requires a user to be logged in. req.getSession()['username'] = '******' dfp.handle(req, '/edit')