Unittest断言错误和编码

时间:2015-06-24 09:43:17

标签: python unit-testing encoding flask assert

我试图为我的烧瓶应用程序编写一个简单的测试。该应用程序是西里尔文。

def test_empty(self):
    res = self.app.get('/')
    assert 'В базе нет ссылок.' in res.data

当我尝试运行此测试时,我得到了

FAIL: test_empty (__main__.LinkTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 17, in test_empty
    assert 'ðÆ ð▒ð░ðÀðÁ ð¢ðÁÐé ÐüÐüÐïð╗ð¥ð║.' in res.data
AssertionError

似乎存在编码问题。

有人可以解释一下这个问题的性质吗?

我在 Windows 7 上使用python 2.7.3

0 个答案:

没有答案