'Test Model redirects after add, delete, edit'

def test_model_redirects(self):

    client = self.app.test_client()
    rv = self.login(client, DEFAULT_ADMIN_USER, DEFAULT_ADMIN_PASSWORD)
    model1 = Model1(field_string='Test    Redirects')
    self.db.session.add(model1)
    model1.id = REDIRECT_OBJ_ID
    self.db.session.flush()
    rv = client.post('/model1viewwithredirects/add', data=dict(field_string='test_redirect', field_integer='1', field_float='0.12', field_date='2014-01-01'), follow_redirects=True)
    eq_(rv.status_code, 200)
    data = rv.data.decode('utf-8')
    ok_(('Test    Redirects' in data))
    model_id = self.db.session.query(Model1).filter_by(field_string='test_redirect').first().id
    rv = client.post('/model1viewwithredirects/edit/{0}'.format(model_id), data=dict(field_string='test_redirect_2', field_integer='2'), follow_redirects=True)
    eq_(rv.status_code, 200)
    ok_(('Test    Redirects' in data))
    rv = client.get('/model1viewwithredirects/delete/{0}'.format(model_id), follow_redirects=True)
    eq_(rv.status_code, 200)
    ok_(('Test    Redirects' in data))
