Skip to content

Commit

Permalink
Initial work for encoding tests: Enable these tests @ CircleCI #1368
Browse files Browse the repository at this point in the history
  • Loading branch information
andresriancho committed Mar 27, 2014
1 parent 1c59a52 commit 9a269bb
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions moth/views/vulnerabilities/core/encoding_utf8.py
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'}

0 comments on commit 9a269bb

Please sign in to comment.