I am following the
and trying to write a passing test based on the
"test_voluntary_login" example:

def test_voluntary_login(self):
    """Voluntary logins should work perfectly"""
    # Requesting the login form:
    login_page = self.app.get('/login', status=200)
    login_form = login_page.form
    login_form['login'] = 'username'
    login_form['password'] = 'password'
    # Submitting the login form:
    login_handler = login_form.submit(status=302)
    assert login_handler.location == 'http://localhost/'
    # Checking that the user was correctly authenticated:
    initial_page = login_handler.follow(status=200)
    assert 'auth_tkt' in initial_page.request.cookies, \
           "Session cookie wasn't defined: %s" %

I'm using the repoze.what Quickstart plugin (just easy installed the most
recent version) with Pylons 1.0 and this test fails
because login_handler.follow(status=200) is 302'ing.

When I leave my test environment and do my own user testing in my
development environment, everything works fine. I've also made certain that
I do in fact have the correct username and password I am trying to
authenticate against in my database.

Can anyone confirm or deny that this example works in Pylons? Any help on
how I can get it to pass?

Repoze-dev mailing list

Reply via email to