'Test roundtripping the db through SQL'

def test_dump_and_restore(self):

    cache = self.init_cache()
    uv = int(cache.backend.user_version)
    all_ids = cache.all_book_ids()
    cache.dump_and_restore()
    self.assertEqual(cache.set_field(u'title', {1: u'nt'}), set([1]), u'database    connection    broken')
    cache = self.init_cache()
    self.assertEqual(cache.all_book_ids(), all_ids, u'dump    and    restore    broke    database')
    self.assertEqual(int(cache.backend.user_version), uv)
