{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/222","labels_url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/222/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/222/events","html_url":"https://github.com/pytest-dev/pytest-django/pull/222","id":63564150,"number":222,"title":"Adds tests for invalid template variables","user":{"login":"codingjoe","id":1772890,"avatar_url":"https://avatars.githubusercontent.com/u/1772890?v=3","gravatar_id":"","url":"https://api.github.com/users/codingjoe","html_url":"https://github.com/codingjoe","followers_url":"https://api.github.com/users/codingjoe/followers","following_url":"https://api.github.com/users/codingjoe/following{/other_user}","gists_url":"https://api.github.com/users/codingjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/codingjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codingjoe/subscriptions","organizations_url":"https://api.github.com/users/codingjoe/orgs","repos_url":"https://api.github.com/users/codingjoe/repos","events_url":"https://api.github.com/users/codingjoe/events{/privacy}","received_events_url":"https://api.github.com/users/codingjoe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-22T19:04:48Z","updated_at":"2015-03-23T00:35:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pytest-dev/pytest-django/pulls/222","html_url":"https://github.com/pytest-dev/pytest-django/pull/222","diff_url":"https://github.com/pytest-dev/pytest-django/pull/222.diff","patch_url":"https://github.com/pytest-dev/pytest-django/pull/222.patch"},"body":"Django catches all `VariableDoesNotExist` exceptions to replace\r\nthem in templates with a modifiable string that you can define in\r\nyour settings.\r\nSadly that doesn't allow you to find them in unit tests.\r\n\r\n`_fail_for_invalid_template_variable` sets the setting\r\n`TEMPLATE_STRING_IF_INVALID` to a custom class that not only fails\r\nthe current test but prints a pretty message including the template\r\nname.\r\n\r\nA new marker allows disabling this behavior, eg:\r\n\r\n    @pytest.mark.ignore_template_errors\r\n    def test_something():\r\n        pass\r\n\r\nThis marker sets the setting to None, if you want it to be a string,\r\nyou can use the `settings` fixture to set it to your desired value."},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/comments/84737961","html_url":"https://github.com/pytest-dev/pytest-django/pull/222#issuecomment-84737961","issue_url":"https://api.github.com/repos/pytest-dev/pytest-django/issues/222","id":84737961,"user":{"login":"blueyed","id":9766,"avatar_url":"https://avatars.githubusercontent.com/u/9766?v=3","gravatar_id":"","url":"https://api.github.com/users/blueyed","html_url":"https://github.com/blueyed","followers_url":"https://api.github.com/users/blueyed/followers","following_url":"https://api.github.com/users/blueyed/following{/other_user}","gists_url":"https://api.github.com/users/blueyed/gists{/gist_id}","starred_url":"https://api.github.com/users/blueyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueyed/subscriptions","organizations_url":"https://api.github.com/users/blueyed/orgs","repos_url":"https://api.github.com/users/blueyed/repos","events_url":"https://api.github.com/users/blueyed/events{/privacy}","received_events_url":"https://api.github.com/users/blueyed/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T00:35:13Z","updated_at":"2015-03-23T00:35:13Z","body":"The problem is likely that you would need to change the `TEMPLATE` setting for Django 1.8+, because you configure it after Django has applied its translation into the new setting."}}