Coverage for /home/tribaal/workspace/django-shop/shop/util/decorators : 96.55%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""Decorators for the django-shop application."""
""" Enables decorators for functions of classes (for example class based views).
Credits go to: http://www.toddreed.name/content/django-view-class/ """
login_url=None): """ Decorator for views that checks that the user is logged in, redirecting to the log-in page if necessary.
Takes the `SHOP_FORCE_LOGIN` setting into consideration. """ get_test_func(), login_url=login_url, redirect_field_name=redirect_field_name ) return actual_decorator
""" Ensures that an non-complete order exists before carrying out any additional functions that rely on one.
If an order does not exist the browser will be redirected to another page supplied in the optional keyword argument `url_name`.
Usage: @order_required def some_view(...
OR: @order_required(url_name='cart') def some_view(... """
""" Ensures that a non-empty cart is present.
If a cart does not exist the browser will be redirected to another page supplied in the optional keyword argument `url_name`.
Usage: @cart_required def some_view(...
OR: @cart_required(url_name='cart') def some_view(... """
|