The function pymongo.command_cursor.CommandCursor.to_list is not present in mongomock.
> return aggregation.to_list()
E AttributeError: 'CommandCursor' object has no attribute 'to_list'
This can easily be worked-around by using list(aggregation), but using the n parameters could be trickier depending on the expected behavior. I'll consider submitting a PR.