#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# dbname = dbname . _config [ 'couchdb.db' ] . dbname #NEWLINE# try : #NEWLINE# #INDENT# self . _config [ 'couchdb.db' ] . server . delete_db ( dbname ) #NEWLINE# #UNINDENT# except ResourceNotFound : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . _config [ 'couchdb.db' ] = init_db ( self . _config [ 'couchdb.uri' ] , dbname ) #NEWLINE# sync_design ( self . _config [ 'couchdb.db' ] , default_design_path ( self . _config ) ) #NEWLINE# if hasattr ( self , 'fixtures' ) : #NEWLINE# #INDENT# fixtures_dir = self . _config [ 'couchdb.fixtures' ] #NEWLINE# if ( not os . path . isdir ( fixtures_dir ) ) : #NEWLINE# #INDENT# raise Exception ( ( 'Fixtures dir %s not found' % fixtures_dir ) ) #NEWLINE# #UNINDENT# FixtureLoader ( fixtures_dir ) . sync ( self . _config [ 'couchdb.db' ] )