How to Unit Test a Route in Flask

Solution
# Ensure that the password-tester behaves correctly given correct credentials
    def test_pass_correct(self):
        tester = app.test_client(self)
        response = tester.post('/register', data=dict(password='testtest'))
        self.assertFalse(b'Field must be at least 8 characters long.' in response.data)

    # Ensure that the password-tester behaves correctly given incorrect credentials
    def test_pass_incorrect(self):
        tester = app.test_client(self)
        response = tester.post('/register', data=dict(password='test'))
        self.assertTrue(b'Field must be at least 8 characters long.' in response.data)