Exemple #1
0
 def create(self):
   self.type='profile'
   if self.owner :
     self.store(loadDatabase (getServer(),dbname=dblayer.YAPOOL_DB))
     return True
   else : 
     return False
Exemple #2
0
 def create(self):
     self.type = 'profile'
     if self.owner:
         self._id = self.owner
         self.store(loadDatabase(getServer(), dbname=dblayer.YAPOOL_DB))
         return True
     else:
         return False
Exemple #3
0
def switchToTestDatabase(replicate=True) :
  '''
  this method change the database to a test database
  the default argument replicate mean that the database is replicate from the original
  so the design document are replicated
  '''
  print '\n------------------Running the couchdbinterface test -------------------------\n'
  print 'switching to test database'
  #easy way to make sure we have a clean database
  dblayer.db=loadDatabase(server,TEST_DB_NAME)
  if replicate :
    server.replicate(dblayer.DB_NAME,TEST_DB_NAME)
  print 'DATABASE TEST ENVIRONMENT: ',server,',',getDb()