小编imd*_*ain的帖子

比较响应数据的单元测试引发TypeError

我正在尝试为示例烧瓶应用程序编写一些单元测试.我想检查响应中是否有特定的字符串.我一直在接受TypeError: 'str' does not support the buffer interface.为什么我会收到此错误,我该如何解决?

======================================================================
ERROR: test_empty_db (__main__.FlaskrTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_flaskr.py", line 31, in test_empty_db
    assert 'No entries here so far' in rv.data
TypeError: 'str' does not support the buffer interface
Run Code Online (Sandbox Code Playgroud)

python flask

2
推荐指数
1
解决办法
297
查看次数

标签 统计

flask ×1

python ×1