Example #1
0
 def test_replacestrregex(self):
     self.assertEqual(self._q(query.replace_str_regex("ABCDE", "AB", "AA")),
                      "AACDE")
     self.assertEqual(
         self._q(
             query.replace_str_regex("One Fish Two fish", "[Ff]ish",
                                     "Cat")), "One Cat Two Cat")
 def test_replace_str_regex(self):
     self.assertJson(
         query.replace_str_regex("one fish two Fish", "[fF]ish", "dog"),
         '{"pattern":"[fF]ish","replace":"dog","replacestrregex":"one fish two Fish"}'
     )