From 5044f3d6101e5915963a497779b6ad1166a7a388 Mon Sep 17 00:00:00 2001 From: teichopsia- Date: Fri, 19 Aug 2016 21:01:13 -0500 Subject: [PATCH] Update testing.rst (#1987) Python 3.4.2 TypeError: Type str doesn't support the buffer API --- docs/testing.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/testing.rst b/docs/testing.rst index fdf57937..0737936e 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -152,13 +152,13 @@ invalid credentials. Add this new test to the class:: def test_login_logout(self): rv = self.login('admin', 'default') - assert 'You were logged in' in rv.data + assert b'You were logged in' in rv.data rv = self.logout() - assert 'You were logged out' in rv.data + assert b'You were logged out' in rv.data rv = self.login('adminx', 'default') - assert 'Invalid username' in rv.data + assert b'Invalid username' in rv.data rv = self.login('admin', 'defaultx') - assert 'Invalid password' in rv.data + assert b'Invalid password' in rv.data Test Adding Messages -------------------- @@ -172,9 +172,9 @@ like this:: title='', text='HTML allowed here' ), follow_redirects=True) - assert 'No entries here so far' not in rv.data - assert '<Hello>' in rv.data - assert 'HTML allowed here' in rv.data + assert b'No entries here so far' not in rv.data + assert b'<Hello>' in rv.data + assert b'HTML allowed here' in rv.data Here we check that HTML is allowed in the text but not in the title, which is the intended behavior.