def setUp(self):
        unittest.TestCase.setUp(self)

        syntax_nr = QRegExp.RegExp
        syntax = QRegExp.PatternSyntax(syntax_nr)
        self._regExp = QRegExp(self._query_text, Qt.CaseInsensitive, syntax)

        self._filter = TextFilter(self._regExp)
        self._filter.set_text(self._query_text)
class MyTest(unittest.TestCase):
    _query_text = 'filter'
    _filtered_text = 'filtered_text'

    def setUp(self):
        unittest.TestCase.setUp(self)

        syntax_nr = QRegExp.RegExp
        syntax = QRegExp.PatternSyntax(syntax_nr)
        self._regExp = QRegExp(self._query_text, Qt.CaseInsensitive, syntax)

        self._filter = TextFilter(self._regExp)
        self._filter.set_text(self._query_text)

    def tearDown(self):
        unittest.TestCase.tearDown(self)

    def test_test_message(self):
        """Testing test_message method."""
        result_regex = self._filter.test_message(self._filtered_text)
        print 'result_regex={}'.format(result_regex)
        self.assertEqual(result_regex,
                         True  # Both _query_text & filtered_text overlaps.
                         )