Skip to content
Browse files

[bug 717063] Use new vote macro in mobile document.html

  • Loading branch information...
1 parent 5b590ce commit 5c3a13f68b10ae3650288f6e217eff6defd222b0 @rlr rlr committed
Showing with 14 additions and 2 deletions.
  1. +4 −1 apps/wiki/templates/wiki/mobile/document.html
  2. +10 −1 apps/wiki/tests/test_templates.py
View
5 apps/wiki/templates/wiki/mobile/document.html
@@ -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 %}
@@ -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 %}
View
11 apps/wiki/tests/test_templates.py
@@ -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
@@ -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']

0 comments on commit 5c3a13f

Please sign in to comment.
Something went wrong with that request. Please try again.