Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
9c7f84a5
Commit
9c7f84a5
authored
Feb 03, 2014
by
Dave St.Germain
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2404 from edx/sarina/fix-unicode-in-subsection
Fix unicode error in subsection
parents
4e1c5954
cb7882e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
common/djangoapps/microsite_configuration/templatetags/microsite.py
+2
-3
common/djangoapps/microsite_configuration/test_microsites.py
+33
-0
No files found.
common/djangoapps/microsite_configuration/templatetags/microsite.py
View file @
9c7f84a5
...
...
@@ -18,7 +18,7 @@ def page_title_breadcrumbs(*crumbs, **kwargs):
"""
separator
=
kwargs
.
get
(
"separator"
,
" | "
)
if
crumbs
:
return
'{}{}{}'
.
format
(
separator
.
join
(
crumbs
),
separator
,
platform_name
())
return
u
'{}{}{}'
.
format
(
separator
.
join
(
crumbs
),
separator
,
platform_name
())
else
:
return
platform_name
()
...
...
@@ -37,4 +37,4 @@ def platform_name():
Django template tag that outputs the current platform name:
{
%
platform_name
%
}
"""
return
MicrositeConfiguration
.
get_microsite_configuration_value
(
'platform_name'
,
settings
.
PLATFORM_NAME
)
\ No newline at end of file
return
MicrositeConfiguration
.
get_microsite_configuration_value
(
'platform_name'
,
settings
.
PLATFORM_NAME
)
common/djangoapps/microsite_configuration/test_microsites.py
0 → 100644
View file @
9c7f84a5
# -*- coding: utf-8 -*-
"""
Tests microsite_configuration templatetags and helper functions.
"""
from
django.test
import
TestCase
from
django.conf
import
settings
from
.templatetags
import
microsite
class
MicroSiteTests
(
TestCase
):
def
test_breadcrumbs
(
self
):
crumbs
=
[
'my'
,
'less specific'
,
'Page'
]
expected
=
u'my | less specific | Page | edX'
title
=
microsite
.
page_title_breadcrumbs
(
*
crumbs
)
self
.
assertEqual
(
expected
,
title
)
def
test_unicode_title
(
self
):
crumbs
=
[
u'øo'
,
u'π tastes gréât'
,
u'驴'
]
expected
=
u'øo | π tastes gréât | 驴 | edX'
title
=
microsite
.
page_title_breadcrumbs
(
*
crumbs
)
self
.
assertEqual
(
expected
,
title
)
def
test_platform_name
(
self
):
pname
=
microsite
.
platform_name
()
self
.
assertEqual
(
pname
,
settings
.
PLATFORM_NAME
)
def
test_breadcrumb_tag
(
self
):
crumbs
=
[
'my'
,
'less specific'
,
'Page'
]
expected
=
u'my | less specific | Page | edX'
title
=
microsite
.
page_title_breadcrumbs_tag
(
None
,
*
crumbs
)
self
.
assertEqual
(
expected
,
title
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment