'Ensure that capped collections with odd max_size work properly.
MongoDB rounds up max_size to next multiple of 256, recreating a doc
with the same spec failed in mongoengine <0.10'

def test_capped_collection_no_max_size_problems(self):

    class Log(Document, ):
        date = DateTimeField(default=datetime.now)
        meta = {'max_size': 10000}
    Log.drop_collection()
    Log().save()
    options = Log.objects._collection.options()
    self.assertEqual(options['capped'], True)
    self.assertTrue((options['size'] >= 10000))
    class Log(Document, ):
        date = DateTimeField(default=datetime.now)
        meta = {'max_size': 10000}
    Log.objects
