Exemplo n.º 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)
Exemplo n.º 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]
Exemplo n.º 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]
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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