def test_simple_docview_from_url(self): url = self.project.get_absolute_url() dv = DocView.from_url(url) self.assertEqual(dv.project, self.project) self.assertEqual(dv.version, self.version) self.assertEqual(dv.language, 'en') self.assertEqual(dv.sphinx_filename, 'index.html')
def log_page_view(request): """ Intended to be used asynchronously, with an ajax callback with page details. """ url = request.GET.get('url') dispatched = resolve(url) if dispatched.url_name.startswith('docs') \ or dispatched.view_name.startswith('docs'): dv = DocView.from_url(url) dv.user = request.user