'Test Security reset password'

def test_sec_reset_password(self):

    client = self.app.test_client()
    rv = client.get('/users/action/resetmypassword/1', follow_redirects=True)
    data = rv.data.decode('utf-8')
    ok_((ACCESS_IS_DENIED in data))
    rv = self.login(client, DEFAULT_ADMIN_USER, DEFAULT_ADMIN_PASSWORD)
    rv = client.get('/users/action/resetmypassword/1', follow_redirects=True)
    data = rv.data.decode('utf-8')
    ok_(('Reset    Password    Form' in data))
    rv = client.post('/resetmypassword/form', data=dict(password='password', conf_password='password'), follow_redirects=True)
    eq_(rv.status_code, 200)
    self.logout(client)
    self.login(client, DEFAULT_ADMIN_USER, 'password')
    rv = client.post('/resetmypassword/form', data=dict(password=DEFAULT_ADMIN_PASSWORD, conf_password=DEFAULT_ADMIN_PASSWORD), follow_redirects=True)
    eq_(rv.status_code, 200)
    rv = client.get('/users/action/resetpasswords/1', follow_redirects=True)
    data = rv.data.decode('utf-8')
    ok_(('Reset    Password    Form' in data))
    rv = client.post('/resetmypassword/form', data=dict(password=DEFAULT_ADMIN_PASSWORD, conf_password=DEFAULT_ADMIN_PASSWORD), follow_redirects=True)
    eq_(rv.status_code, 200)
