def test_cast_datetime(self):
     date = datetime(2012, 12, 12, 12, 12, 12, 0)
     with self.app.app_context():
         s = date_to_str(date)
         self.assertEquals(try_cast(s).day, date.day)
 def test_cast_datetime(self):
     date = datetime(2012, 12, 12, 12, 12, 12, 0)
     with self.app.app_context():
         s = date_to_str(date)
         self.assertEquals(try_cast(s).day, date.day)
 def test_cast_objectid(self):
     self.assertEquals(try_cast(str(self._id)), self._id)
 def test_cast_objectid(self):
     self.assertEquals(try_cast(str(self._id)), self._id)