review/tests/test_encoding.py @ d6523b4269f8
webui: Add a signoff default value, prevent issue56
author |
Benoit Allard <benoit@aeteurope.nl> |
date |
Tue, 27 Jul 2010 13:13:43 +0200 |
parents |
a21fcb365fcd |
children |
cada9aab8b6f |
# coding=utf-8
#
import os
from nose import with_setup
from util import setup_reviewed_sandbox, teardown_sandbox, review, should_fail_with
from util import get_datastore_repo, get_sandbox_repo, get_ui
from util import check_comment_exists_on_line
from .. import api, messages, rutil
from mercurial.node import hex
@with_setup(setup_reviewed_sandbox(), teardown_sandbox)
def test_comment_encoding():
review(comment=True, message=rutil.tolocal(u'Téstíng.'))
output = review()
assert messages.REVIEW_LOG_COMMENT_LINE % rutil.tolocal(u'Téstíng.') in output
@with_setup(setup_reviewed_sandbox(), teardown_sandbox)
def test_signoff_encoding():
review(signoff=True, message=rutil.tolocal(u'Téstíng.'))
output = review()
assert messages.REVIEW_LOG_SIGNOFF_LINE % rutil.tolocal(u'Téstíng.') in output
@with_setup(setup_reviewed_sandbox(username=u'Tést <tést@test.com>', encoding='UTF-8'), teardown_sandbox)
def test_username_encoding_utf8():
review(comment=True, message=rutil.tolocal(u'Cómment.'))
output = review()
assert u'Tést'.encode('UTF-8') in output
assert u'Cómment.'.encode('UTF-8') in output
@with_setup(setup_reviewed_sandbox(username=u'Tést <tést@test.com>', encoding='ISO-8859-1'), teardown_sandbox)
def test_username_encoding_iso_8859_1():
review(comment=True, message=rutil.tolocal(u'Cómment.'))
output = review()
assert u'Tést'.encode('ISO-8859-1') in output
assert u'Cómment.'.encode('ISO-8859-1') in output