Пример #1
0
 def test_welcomePage(self):
     """ Test the GET request """
     logs = load(open_log_file('welcom_page.json'))
     self.request.form['requests'] = logs
     # replay the request
     player = getMultiAdapter((self.portal, self.request), name='requests_player')
     response = player.playRequests()
     self.assertTrue("There are currently no active content rules" in response)
Пример #2
0
 def setup(self):
     # Import requests.
     if hasattr(self.request, 'datafile'):
         self.requests = load(self.request.datafile)
     # But sometimes we do not want to import http requests.
     else:
         # The 'list' is used due to a compatibility with the 'load' function.
         self.requests = [ALLOWED_INPUT_PARAMS]
Пример #3
0
 def setup(self):
     # Import requests.
     if hasattr(self.request, "datafile"):
         self.requests = load(self.request.datafile)
     # But sometimes we do not want to import http requests.
     else:
         # The 'list' is used due to a compatibility with the 'load' function.
         self.requests = [ALLOWED_INPUT_PARAMS]
Пример #4
0
 def replay(self, logname):
     """ Replay the log file and store changes """
     logs = load(open_log_file(logname))
     self.request.form['requests'] = logs
     # replay the request
     player = getMultiAdapter((self.portal, self.request), name='requests_player')
     response = player.playRequests()
     # apply request
     transaction.commit()
     return response
Пример #5
0
 def test_welcomePage(self):
     """ Test the GET request """
     logs = load(open_log_file('welcom_page.json'))
     self.request.form['requests'] = logs
     # replay the request
     player = getMultiAdapter((self.portal, self.request),
                              name='requests_player')
     response = player.playRequests()
     self.assertTrue(
         "There are currently no active content rules" in response)
Пример #6
0
 def replay(self, logname):
     """ Replay the log file and store changes """
     logs = load(open_log_file(logname))
     self.request.form['requests'] = logs
     # replay the request
     player = getMultiAdapter((self.portal, self.request),
                              name='requests_player')
     response = player.playRequests()
     # apply request
     transaction.commit()
     return response