bug 999371, add a simple test case to test the tag
add name and contact info to AUTHORS file. Change Author in the commit message, add email to .mailmap Change-Id: Ic9aba5dfde0aae0faee6b944d253cd3d9d8ea4e7
This commit is contained in:
parent
0d8273463d
commit
d958f82bb8
1
.mailmap
1
.mailmap
@ -6,3 +6,4 @@
|
|||||||
<launchpad@markgius.com> <mgius7096@gmail.com>
|
<launchpad@markgius.com> <mgius7096@gmail.com>
|
||||||
<yorik.sar@gmail.com> <yorik@ytaraday>
|
<yorik.sar@gmail.com> <yorik@ytaraday>
|
||||||
<jeblair@hp.com> <james.blair@rackspace.com>
|
<jeblair@hp.com> <james.blair@rackspace.com>
|
||||||
|
<ke.wu@ibeca.me> <ke.wu@nebula.com>
|
||||||
|
1
AUTHORS
1
AUTHORS
@ -32,6 +32,7 @@ John Postlethwait <john.postlethwait@nebula.com>
|
|||||||
Joseph Heck <heckj@mac.com>
|
Joseph Heck <heckj@mac.com>
|
||||||
Joshua McKenty <joshua@pistoncloud.com>
|
Joshua McKenty <joshua@pistoncloud.com>
|
||||||
Julien Danjou <julien.danjou@enovance.com>
|
Julien Danjou <julien.danjou@enovance.com>
|
||||||
|
Ke Wu <ke.wu@ibeca.me>
|
||||||
Ken Pepple <ken.pepple@gmail.com>
|
Ken Pepple <ken.pepple@gmail.com>
|
||||||
Mark Gius <launchpad@markgius.com>
|
Mark Gius <launchpad@markgius.com>
|
||||||
Michael Szilagyi <mszilagyi@gmail.com>
|
Michael Szilagyi <mszilagyi@gmail.com>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% load horizon i18n %}
|
{% load branding horizon i18n %}
|
||||||
|
|
||||||
<div class='sidebar'>
|
<div class='sidebar'>
|
||||||
<h1 class="brand clearfix"><a href="{% url horizon:user_home %}">{% trans "OpenStack Dashboard" %}</a></h1>
|
<h1 class="brand clearfix"><a href="{% url horizon:user_home %}">{% site_branding %}</a></h1>
|
||||||
|
|
||||||
{% horizon_main_nav %}
|
{% horizon_main_nav %}
|
||||||
|
|
||||||
|
@ -23,6 +23,9 @@ import re
|
|||||||
from django.utils.text import normalize_newlines
|
from django.utils.text import normalize_newlines
|
||||||
|
|
||||||
from horizon import test
|
from horizon import test
|
||||||
|
from horizon.templatetags import branding
|
||||||
|
from django.template import Context, Template
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
def single_line(text):
|
def single_line(text):
|
||||||
@ -33,4 +36,15 @@ def single_line(text):
|
|||||||
|
|
||||||
|
|
||||||
class TemplateTagTests(test.TestCase):
|
class TemplateTagTests(test.TestCase):
|
||||||
pass
|
'''Test Custom Template Tag'''
|
||||||
|
def render_template_tag(self, tag_name, tag_require=''):
|
||||||
|
'''Render a Custom Template Tag to string'''
|
||||||
|
template = Template("{%% load %s %%}{%% %s %%}"
|
||||||
|
% (tag_require, tag_name))
|
||||||
|
return template.render(Context())
|
||||||
|
|
||||||
|
def test_site_branding_tag(self):
|
||||||
|
'''Test if site_branding tag renders the correct setting'''
|
||||||
|
rendered_str = self.render_template_tag("site_branding", "branding")
|
||||||
|
self.assertEqual(settings.SITE_BRANDING, rendered_str.strip(),
|
||||||
|
"tag site_branding renders %s" % rendered_str.strip())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user