def get_request(self, form_data={}): """ The request generator for this TestCase. This returns a Store-enabled request. """ environ = test.generate_test_wsgi_environment(form_data) environ['REQUEST_URI'] = '/app-test/test-resource' environ['HTTP_HOST'] = '____store-test-domain____:1234567' environ['SERVER_NAME'] = '____store-test-domain____' environ['HTTP_PORT'] = '1234567' application = app.get_application(environ) self.failIf(application is None, "Didn't get an application object.") req = app.configure_request(environ, application) req['modu.pool'] = dbapi.connect(application.db_url) req['modu.user'] = test.TestAdminUser() persist.activate_store(req) return req
def get_request(self, form_data={}): """ The request generator for this TestCase. This particular implementation will return a Request object that has had a store instance defined for it. """ environ = test.generate_test_wsgi_environment(form_data) environ['REQUEST_URI'] = '/app-test/test-resource' environ['HTTP_HOST'] = '____store-test-domain____:1234567' environ['SERVER_NAME'] = '____store-test-domain____' environ['HTTP_PORT'] = '1234567' application = app.get_application(environ) self.failIf(application is None, "Didn't get an application object.") req = app.configure_request(environ, application) req['modu.pool'] = dbapi.connect(application.db_url) req['modu.user'] = test.TestAdminUser() queue.activate_content_queue(req) persist.activate_store(req) return req