'Test refreshing the view after a change to metadata.db'

def test_refresh(self):

    db = self.init_legacy()
    db2 = self.init_legacy()
    time.sleep(1)
    self.assertEqual(db2.data.cache.set_field(u'title', {1: u'xxx'}), set([1]))
    db2.close()
    del db2
    self.assertNotEqual(db.title(1, index_is_id=True), u'xxx')
    db.check_if_modified()
    self.assertEqual(db.title(1, index_is_id=True), u'xxx')
