summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-27 11:27:11 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-27 11:27:11 -0400
commit6838a4cd8638aacc924f5ab8f208e1d31696349b (patch)
tree674f8189d51bda96a25fa97c7c25a433a33e246b
parentc64b4fb60822278ac32286c289b10a61004a729a (diff)
parent56f56f2077d4e4f5fc149eb222e33801ad036033 (diff)
downloadaskbot-6838a4cd8638aacc924f5ab8f208e1d31696349b.tar.gz
askbot-6838a4cd8638aacc924f5ab8f208e1d31696349b.tar.bz2
askbot-6838a4cd8638aacc924f5ab8f208e1d31696349b.zip
Merge branch 'master' into kp-dev
-rw-r--r--askbot/templates/base.html9
-rw-r--r--askbot/templates/meta/html_head_meta.html8
-rw-r--r--askbot/tests/page_load_tests.py12
3 files changed, 20 insertions, 9 deletions
diff --git a/askbot/templates/base.html b/askbot/templates/base.html
index eaf2261d..63d7115f 100644
--- a/askbot/templates/base.html
+++ b/askbot/templates/base.html
@@ -2,7 +2,14 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title>
- {% include "meta/html_head_meta.html" %}
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ {% block meta_description %}
+ <meta name="description" content="{{settings.APP_DESCRIPTION|escape}}" />
+ {% endblock %}
+ <meta name="keywords" content="{%block keywords%}{%endblock%},{{settings.APP_KEYWORDS|escape}}" />
+ {% if settings.GOOGLE_SITEMAP_CODE %}
+ <meta name="google-site-verification" content="{{settings.GOOGLE_SITEMAP_CODE}}" />
+ {% endif %}
<link rel="shortcut icon" href="{{ settings.SITE_FAVICON|media }}" />
{% block before_css %}{% endblock %}
{% include "meta/html_head_stylesheets.html" %}
diff --git a/askbot/templates/meta/html_head_meta.html b/askbot/templates/meta/html_head_meta.html
deleted file mode 100644
index 352ffb53..00000000
--- a/askbot/templates/meta/html_head_meta.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-{% block meta_description %}
-<meta name="description" content="{{settings.APP_DESCRIPTION|escape}}" />
-{% endblock %}
-<meta name="keywords" content="{%block keywords%}{%endblock%},{{settings.APP_KEYWORDS|escape}}" />
-{% if settings.GOOGLE_SITEMAP_CODE %}
-<meta name="google-site-verification" content="{{settings.GOOGLE_SITEMAP_CODE}}" />
-{% endif %}
diff --git a/askbot/tests/page_load_tests.py b/askbot/tests/page_load_tests.py
index 0f102975..293cb78d 100644
--- a/askbot/tests/page_load_tests.py
+++ b/askbot/tests/page_load_tests.py
@@ -9,6 +9,7 @@ from django.utils import simplejson
import coffin
import coffin.template
+from bs4 import BeautifulSoup
from askbot import models
from askbot.utils.slug import slugify
@@ -568,6 +569,17 @@ class AvatarTests(AskbotTestCase):
)
+class QuestionViewTests(AskbotTestCase):
+ def test_meta_description_has_question_summary(self):
+ user = self.create_user('user')
+ text = 'this is a question'
+ question = self.post_question(user=user, body_text=text)
+ response = self.client.get(question.get_absolute_url())
+ soup = BeautifulSoup(response.content)
+ meta_descr = soup.find_all('meta', attrs={'name': 'description'})[0]
+ self.assertTrue(text in meta_descr.attrs['content'])
+
+
class QuestionPageRedirectTests(AskbotTestCase):
def setUp(self):