during development of large ecommerce site we ran into an exception
when accessing the list of offers and ranges:
AttributeError 'NoneType' object has no attribute 'paginator'
django_rangepaginator/templatetags/rangepaginator.py in paginate at line 12
This PR fixes all cases I could find where this happens, but chances are
some views need the same fix.
- split out the queryset filters into separate methods for easy overloading
in subclasses, i.e. have the keyword search in product titles as well.
- cleanup the get_date_from_to_queryset method a little to make it more dry.
- expand test-coverage for the affected code.
The idea of splitting integration from unittests is good in theory
but leads to a lot of mental overhead. Besides whenever a tests
interacts with a database it isn't a unittest anyway.
Replace assert statements with appropriate assert* method.
Replace 'assert' with 'assert*' method.
Convert tests.unit.forms.widget_tests to use TestCase class.
Convert bankcard tests to use TestCase.
Convert tests.unit.logging_tests to use TestCase.
Make access check function for dashboard easier to customise
* It can now be specified in OSCAR_DASHBOARD_DEFAULT_ACCESS_FUNCTION
* nav.py and menu.py were split up so that Node can be dynamically
loaded and hence overridden
I recently needed to alter the access function and realised it's not as
easy as I thought.