import unittest
import saliweb.test

# Import the modfoo frontend with mocks
modfoo = saliweb.test.import_mocked_frontend("modfoo", __file__,
                                             '../../frontend')


class Tests(saliweb.test.TestCase):

    def test_index(self):
        """Test index page"""
        c = modfoo.app.test_client()
        rv = c.get('/')
        self.assertIn('ModFoo: Modeling using Foo', rv.data)


if __name__ == '__main__':
    unittest.main()

import unittest
import saliweb.test

# Import the modfoo frontend with mocks
modfoo = saliweb.test.import_mocked_frontend("modfoo", __file__,
                                             '../../frontend')


class Tests(saliweb.test.TestCase):

    def test_index(self):
        """Test index page"""
        c = modfoo.app.test_client()
        rv = c.get('/')
        self.assertIn(b'ModFoo: Modeling using Foo', rv.data)


if __name__ == '__main__':
    unittest.main()

Use bytes to check Flask response
Use bytes to check Flask response

The Flask response is a byte (not Unicode)
string, so we should explicitly compare it
to a bytes constant so the test works in
both Python 2 and Python 3.
