import unittest
import requests


class SmokeTest(unittest.TestCase):
    def test_maths(self):
        self.assertEquals(6, 2 + 4)

    def test_home_page_is_about_todo_lists(self):
        request = requests.get('http://localhost:5000')
        self.assertTrue(
            request.content.startswith(bytes('\n\n<!doctype html>\n', 'utf-8')))
        self.assertIn(
            '<title>\n  \n    tdd_with_python\n  \n    \n  </title>\n',
            request.text)
        self.assertTrue(
            request.content.endswith(bytes('</body>\n</html>\n', 'utf-8')))


class TestMainPage:
    """WebTest test for title"""

    def test_main_page_returns_200(self, user, testapp):
        """Login successful."""
        # Goes to homepage
        res = testapp.get('/')
        assert res.status_code == 200

    def test_main_page_returns_expected_title(self, user, testapp):
        res = testapp.get('/')
        assert '<title>\n  \n    tdd_with_python\n  \n    \n  </title>\n' in res

@@ -297,21 +297,16 @@
 tswith(b
-ytes(
 '%5Cn%5Cn%3C!d
@@ -320,26 +320,16 @@
 html%3E%5Cn'
-, 'utf-8')
 ))%0A     
@@ -464,37 +464,24 @@
 .assertTrue(
-%0A            
 request.cont
@@ -498,13 +498,8 @@
 th(b
-ytes(
 '%3C/b
@@ -518,21 +518,10 @@
 %3E%5Cn'
-, 'utf-8')))%0A
+))
 %0A%0Acl
@@ -938,8 +938,114 @@
  in res%0A
+%0A    # def test_main_page_returns_expected_content(self, user, testapp):%0A    #     res = testapp.get('/')%0A

Use less verbose byte string syntax