Skip to content

Instantly share code, notes, and snippets.

@LucasMagnum
Created August 17, 2017 20:35
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/efe74895552ebd24c5897db90b81712a to your computer and use it in GitHub Desktop.
Save LucasMagnum/efe74895552ebd24c5897db90b81712a to your computer and use it in GitHub Desktop.
Debugger categories list #djangotip02
# $ python app/manage.py shell
from products.queries import (
categories_list,
categories_list_prefetch_related,
debugger_categories_list_prefetch_related
)
# assert categories list and categories with prefetch return the same values
assert len(categories_list()) == 50
assert categories_list() == categories_list_prefetch_related()
_ = debugger_categories_list_prefetch_related()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment