'Test Security Login, Logout, invalid login, invalid access'

def test_sec_login(self):

    client = self.app.test_client()
    rv = client.get('/model1view/list/')
    eq_(rv.status_code, 302)
    rv = client.get('/model2view/list/')
    eq_(rv.status_code, 302)
    self.login(client, DEFAULT_ADMIN_USER, DEFAULT_ADMIN_PASSWORD)
    rv = client.get('/model1view/list/')
    eq_(rv.status_code, 200)
    rv = client.get('/model2view/list/')
    eq_(rv.status_code, 200)
    self.logout(client)
    rv = client.get('/model1view/list/')
    eq_(rv.status_code, 302)
    rv = client.get('/model2view/list/')
    eq_(rv.status_code, 302)
    rv = self.login(client, DEFAULT_ADMIN_USER, 'password')
    data = rv.data.decode('utf-8')
    ok_((INVALID_LOGIN_STRING in data))
