def testmodels(app_models_env):
    """
    Pytest fixture that deletes existing records in any models in
    app_models_env.models (an OrderedDict used to access the models).
    Returns the OrderedDict, with all models emptied.
    """
    testmodels = app_models_env.models
    for model in testmodels.values():
        if hasattr(model, 'objects') and len(model.objects.all()):
            model.objects.all().delete()
    return testmodels