Skip to content

Instantly share code, notes, and snippets.

@LucasMagnum
Created August 17, 2017 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LucasMagnum/65425f73807da299b08acac8ef393daa to your computer and use it in GitHub Desktop.
Save LucasMagnum/65425f73807da299b08acac8ef393daa to your computer and use it in GitHub Desktop.
Check category functions
# $ python app/manage.py shell
from products.queries import (
categories_list_active_subcategories,
categories_list_active_subcategories_using_prefetch_attr,
categories_list_active_subcategories_using_prefetch_queryset
)
results = [
categories_list_active_subcategories(),
categories_list_active_subcategories_using_prefetch_attr(),
categories_list_active_subcategories_using_prefetch_queryset(),
]
assert len(results[0]) == 50
assert results[0] == results[1] == results[2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment