def METHOD_NAME(self):
    def existInList(node, l):  # noqa: E741
        found = False
        for entry in l:
            if entry.id == node.get('id'):
                found = True
                break
        if not found:
            print((node.get('id')))
            return False
        if 'children' in node:
            for child in node.get('children'):
                if not existInList(child, l):
                    return False
        return True
    from chsdi.models.bod import Catalog
    from sqlalchemy.orm import scoped_session, sessionmaker
    DBSession = scoped_session(sessionmaker())
    old_staging = self.testapp.app.registry.settings['geodata_staging']
    # We fix staging for next calls to prod
    self.testapp.app.registry.settings['geodata_staging'] = u'prod'
    try:
        topics = self.testapp.get('/rest/services', status=200)
        for t in topics.json['topics']:
            topic = t.get('id')
            # Get catalog
            catalog = self.testapp.get('/rest/services/' + topic + '/CatalogServer', status=200)
            # Get flat catalog table entries
            query = DBSession.query(Catalog).filter(Catalog.topic == topic).filter(Catalog.staging == u'prod')
            entries = query.all()
            # Check if every node in the catalog is in view_catalog of db
            self.assertTrue(existInList(catalog.json['results']['root'], entries))
    finally:
        # reset staging to previous setting
        self.testapp.app.registry.settings['geodata_staging'] = old_staging
        DBSession.close()