Skip to content

Commit

Permalink
[bug 717063] Use new vote macro in mobile document.html
Browse files Browse the repository at this point in the history
  • Loading branch information
rlr committed Jan 10, 2012
1 parent ea4d573 commit d708da6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/wiki/templates/wiki/mobile/document.html
Expand Up @@ -2,6 +2,7 @@
{% extends "mobile/base.html" %}
{% from "includes/common_macros.html" import list_view_item %}
{% from "wiki/includes/document_macros.html" import related_articles, contributor_list, document_title, document_messages, document_content %}
{% from "wiki/includes/document_macros.html" import vote_form with context %}
{% set title = _('{t} | {c}')|f(t=document.title, c=document.get_category_display()) %}
{% set show_search = 'bottom' %}
{% set include_showfor = True %}
Expand All @@ -20,5 +21,7 @@
{{ contributor_list(contributors) }}
{{ related_articles(related, document) }}
</article>
{% include 'wiki/includes/document_vote.html' %}
{% if not waffle.switch('hide-voting') %}
{{ vote_form(document) }}
{% endif %}
{% endblock %}
11 changes: 10 additions & 1 deletion apps/wiki/tests/test_templates.py
Expand Up @@ -18,7 +18,7 @@

from questions.tests import tags_eq
from sumo.helpers import urlparams
from sumo.tests import post, get, attrs_eq
from sumo.tests import post, get, attrs_eq, MobileTestCase
from sumo.urlresolvers import reverse
from users.tests import user, add_permission
from wiki.cron import calculate_related_documents
Expand Down Expand Up @@ -309,6 +309,15 @@ def test_links_follow(self):
assert 'rel' not in doc('#doc-content a')[0].attrib


class MobileArticleTemplate(MobileTestCase):
def test_document_view(self):
"""Verify mobile template doesn't 500."""
r = revision(save=True, content='Some text.', is_approved=True)
response = self.client.get(r.document.get_absolute_url())
eq_(200, response.status_code)
self.assertTemplateUsed(response, 'wiki/mobile/document.html')


class RevisionTests(TestCaseBase):
"""Tests for the Revision template"""
fixtures = ['users.json']
Expand Down

0 comments on commit d708da6

Please sign in to comment.