{"action":"created","issue":{"url":"https://api.github.com/repos/django-oscar/django-oscar/issues/1991","repository_url":"https://api.github.com/repos/django-oscar/django-oscar","labels_url":"https://api.github.com/repos/django-oscar/django-oscar/issues/1991/labels{/name}","comments_url":"https://api.github.com/repos/django-oscar/django-oscar/issues/1991/comments","events_url":"https://api.github.com/repos/django-oscar/django-oscar/issues/1991/events","html_url":"https://github.com/django-oscar/django-oscar/issues/1991","id":130466026,"number":1991,"title":"tests/_site/templates/layout.html omits {% block content_wrapper %}","user":{"login":"zbmott","id":8060543,"avatar_url":"https://avatars1.githubusercontent.com/u/8060543?v=4","gravatar_id":"","url":"https://api.github.com/users/zbmott","html_url":"https://github.com/zbmott","followers_url":"https://api.github.com/users/zbmott/followers","following_url":"https://api.github.com/users/zbmott/following{/other_user}","gists_url":"https://api.github.com/users/zbmott/gists{/gist_id}","starred_url":"https://api.github.com/users/zbmott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbmott/subscriptions","organizations_url":"https://api.github.com/users/zbmott/orgs","repos_url":"https://api.github.com/users/zbmott/repos","events_url":"https://api.github.com/users/zbmott/events{/privacy}","received_events_url":"https://api.github.com/users/zbmott/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-02-01T19:54:23Z","updated_at":"2017-12-17T15:42:55Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I have recently been working on improving `OSCAR_HIDDEN_FEATURES` so that it supports the `\"wishlists\"` and `\"alerts\"` keys.  One facet of my effort was to hide the \"Wish Lists\" link on `/accounts/profile` when the `\"wishlists\"` feature is hidden.\n\nMy test plan for this particular modification is very simple:\n1. Render `/accounts/profile` and verify that a link to `/accounts/wishlists` is present.\n2. Use a context manager to temporarily add `\"wishlists\"` to `OSCAR_HIDDEN_FEATURES`, render `/accounts/profile`, and verify that a link to `/accounts/wishlists` is **not** present.\n\nThe following test case implements this plan:\n\n``` python\nfrom django.core.urlresolvers import reverse\n\nfrom oscar.test.testcases import WebTestCase\n\n\nclass TestProfilePage(WebTestCase):\n    is_anonymous = False\n\n    def test_wishlists_link_exists(self):\n        account_page = self.get(reverse('customer:profile-view'))\n\n        html = account_page.content.decode('utf-8')\n        self.assertTrue(reverse('customer:wishlists-list') in html)\n\n    def test_wishlists_link_does_not_exist(self):\n        with self.settings(OSCAR_HIDDEN_FEATURES=['wishlists']):\n            account_page = self.get(reverse('customer:profile-view'))\n\n        html = account_page.content.decode('utf-8')\n        self.assertFalse(reverse('customer:wishlists-list') in html)  \n```\n\nUnfortunately, `TestProfilePage.test_wishlists_link_exists` fails.\n\nI have investigated the source of this failure and determined that it arises from the differences between `src/oscar/templates/oscar/layout.html` and `tests/_site/templates/layout.html`.  The former defines `{% block content_wrapper %}`, while the latter does not.  This is significant because `templates/oscar/customer/baseaccountpage.html` extends `templates/oscar/layout_2col.html` and renders the left navigation (where I expect the link to appear) into `{% block column_left %}`.  `{% block column_left %}` is defined by `layout_2col.html` within `{% block content_wrapper %}`.\n\nThus, because `tests/_site/templates/layout.html` does not define `{% block content_wrapper %}`, `{% block column_left %}` is not rendered, and `TestProfilePage.test_wishlists_link_exists` fails.\n\nI suspect that `tests/_site/templates/layout.html` has been simplified to avoid rendering unnecessary HTML during tests.  This issue documents a case where rendering the full `layout.html` could contribute to improved test coverage.\n"},"comment":{"url":"https://api.github.com/repos/django-oscar/django-oscar/issues/comments/352264534","html_url":"https://github.com/django-oscar/django-oscar/issues/1991#issuecomment-352264534","issue_url":"https://api.github.com/repos/django-oscar/django-oscar/issues/1991","id":352264534,"user":{"login":"sasha0","id":673711,"avatar_url":"https://avatars1.githubusercontent.com/u/673711?v=4","gravatar_id":"","url":"https://api.github.com/users/sasha0","html_url":"https://github.com/sasha0","followers_url":"https://api.github.com/users/sasha0/followers","following_url":"https://api.github.com/users/sasha0/following{/other_user}","gists_url":"https://api.github.com/users/sasha0/gists{/gist_id}","starred_url":"https://api.github.com/users/sasha0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sasha0/subscriptions","organizations_url":"https://api.github.com/users/sasha0/orgs","repos_url":"https://api.github.com/users/sasha0/repos","events_url":"https://api.github.com/users/sasha0/events{/privacy}","received_events_url":"https://api.github.com/users/sasha0/received_events","type":"User","site_admin":false},"created_at":"2017-12-17T15:42:55Z","updated_at":"2017-12-17T15:42:55Z","author_association":"MEMBER","body":"During the latest review I had a closer look on feature disable functionality and found out that wishlists URL is not hidden yet on the account page, when feature is disabled, simply because it's not wrapped with `{% iffeature \"wishlists\" %}{% endiffeature %}` tag.\r\n\r\n@zbmott you were right regarding the test template - not having `{% content_wrapper %}` block prevented from proper testing of account navigation, so I added it in PR #2522."}}
{"actor":{"display_login":"sasha0"}}