Please sign in to comment.
[FIX] website, website_sale: create utility method to check if frontend
Before this commit, at multiple places to check if we were in a frontend context we would check if `request and hasattr(request, 'website')` and then access `request.website`. Now, we call an utility method to get that website if we are in a frontend context. If not the method will return False. This method will be usefull for incoming pricelist fixes & tests. Indeed, we will have more check of that kind and this will be easier to mock as mocking this method will be enough, instead of mocking every method doing that if condition to simulate a frontend context (to do website tests in python wihout having to go frontend with a tour).
- Loading branch information...
Showing with 23 additions and 4 deletions.