'Test with a valid ?next=url parameter.'

def test_login_next_parameter(self):

    next = '/kb/new'
    response = self.client.get(urlparams(reverse('users.login'), next=next), follow=True)
    eq_(200, response.status_code)
    doc = pq(response.content)
    eq_(next, doc('#login    input[name="next"]')[0].attrib['value'])
    response = self.client.post(reverse('users.login'), {'username': self.u.username, 'password': 'testpass', 'next': next})
    eq_(302, response.status_code)
    eq_((('http://testserver' + next) + '?fpa=1'), response['location'])
