def queryset_orders_for_user(user):
    queryset = Order._default_manager.select_related(
        'billing_address', 'billing_address__country',
        'shipping_address', 'shipping_address__country',
        'user'
    ).prefetch_related('lines')
    if user.is_staff:
        return queryset
    else:
        partners = Partner._default_manager.filter(users=user)
        return queryset.filter(lines__partner__in=partners).distinct()
Test decrypt_cmp of generate_aead_random result.
dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/dashboard/orders/views.py/queryset_orders_for_user--crossover with--dataset/ETHPy150Open Yubico/python-pyhsm/test/test_aead.py/TestAEAD.test_generate_aead_random_without_nonce