def max_farmers(collection): # pragma: no cover
    """Returns the maximum number of farmers recorded in the collection"""
    max_farmers = 0
    for doc in collection.find({}).sort([('total_farmers',-1)]).limit(1):
        max_farmers = doc['total_farmers']
    return max_farmers