def fake_db_cluster(**updates):
 db_cluster = cluster_basic_fields()
 for (name, field) in objects.Cluster.fields.items():
  if (name in db_cluster):
   continue
  if (field.default != fields.UnspecifiedDefault):
   db_cluster[name] = field.default
  elif field.nullable:
   db_cluster[name] = None
  else:
   raise Exception(('fake_db_cluster needs help with %s.' % name))
 if updates:
  db_cluster.update(updates)
 return db_cluster

def fake_db_cluster ( ** updates ) : db_cluster = cluster_basic_fields ( ) for ( name , field ) in objects . Cluster . fields . items ( ) : if ( name in db_cluster ) : continue if ( field . default != fields . UnspecifiedDefault ) : db_cluster [ name ] = field . default elif field . nullable : db_cluster [ name ] = None else : raise Exception ( ( 'fake_db_cluster needs help with %s.' % name ) ) if updates : db_cluster . update ( updates ) return db_cluster
helper method for fake_cluster_orm .