-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work for encoding tests: Enable these tests @ CircleCI #1368
Found pytries/datrie#20
- Loading branch information
1 parent
1c59a52
commit 9a269bb
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from moth.views.base.html_template_view import HTMLTemplateView | ||
|
||
|
||
HTML = u'''<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=%(charset)s"> | ||
</head> | ||
<body> | ||
%(body)s | ||
</body> | ||
</html>''' | ||
|
||
# | ||
# FIXME: https://github.com/kmike/datrie/issues/20 | ||
# FIXME: This issue blocks any progress with encoding testing | ||
# | ||
|
||
class UTF8WithJapaneseCharactersView(HTMLTemplateView): | ||
title = 'UTF-8 test with Japanese characters' | ||
description = 'UTF-8 test with Japanese characters in filename (link is' \ | ||
' not URL encoded) and content.' | ||
url_path = u'改.py' | ||
extra_headers = {'Content-Type': 'text/html; charset=utf-8'} | ||
|
||
HTML = HTML % {'charset': 'utf-8', | ||
'body': u'넓 넘 넙 넸 넹'.encode('utf-8')} | ||
|
||
|
||
class UTF8WithECuteView(HTMLTemplateView): | ||
title = 'UTF-8 test with e cute' | ||
description = 'UTF-8 test with e cute in filename (link is not URL' \ | ||
' encoded)' | ||
url_path = u'é.py' | ||
extra_headers = {'Content-Type': 'text/html; charset=utf-8'} | ||
|
||
HTML = HTML % {'charset': 'utf-8', | ||
'body': u'Space filler'} |