def setUp(self):
   try:
     drop_database(env)
   except:
     pass
   create_database(env)
   self.db = connect(env)
   self.db.check_views()
  def setUp(self):
    try:
      drop_database(env)
    except:
      pass
    create_database(env)
    self.db = connect(env)
    self.db.check_views()
    created_at = '2012-02-20T00:%02d:00Z'
    for i in range(5):
      key = 'doc_%d' % i
      doc = {
        'created_at' : created_at % i,
      }        
      self.db[key] = doc

      image_name= "test_037233.png"
      image = open(get_fixture(image_name))
      self.db.put_attachment(doc, image.read(), filename="snapshot.png")
 def tearDown(self):
   drop_database(env)
   pass