def test_json_on_page(self):
        self.create_thread()
        response = self.client.get(reverse('threads'))
        escaped_json = escapejs(response.context['js_context'])
        self.assertContains(
            response,
            'JSON.parse("{escaped_json}")'.format(escaped_json=escaped_json)
        )
Test that the JSON object is actually on the resulting page
dataset/ETHPy150Open ofa/connect/open_connect/connectmessages/tests/test_views.py/InboxViewTest.test_json_on_page