I'm having a hard time making this simple test work:
class TestNotlogedUser(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
self.testapp = webtest.TestApp(application)
self.testbed = testbed.Testbed()
self.testbed.activate()
self.testbed.init_datastore_v3_stub()
self.testbed.init_user_stub()
def tearDown(self):
self.testbed.deactivate()
def test_user_profile_301(self):
resp = self.testapp.get('/profile/logout/')
resp.click(linkid='logout') # user logs out
resp = self.testapp.get('/profile/')
self.assertEquals(resp.status_int, 301, resp) # user is redirected to a login page
But it throws this error:
AppError: Bad response: 404 NOT FOUND (not 200 OK or 3xx redirect for http://localhost/accounts/Logout?continue=http%3A//testbed.example.com/)
This part is the one causing trouble continue=http%3A//testbed.example.com
, I want to change the host to localhost:8080
.
Acording to the github source you pass an extra_environ
to the constructor:
:param extra_environ:
A dictionary of values that should go
into the environment for each request. These can provide a
communication channel with the application.
My question is it is possible to change the testbed.example.com
as a value of this parameter, I'm still loking at source but it seems there's not documentation for the name of the keys of this extra_environ
dictionary.