Exemplo n.º 1
0
 def test_single(self):
     response = testing.DummyRequest().response
     response.unicode_body = u"<html><body></body></html>"
     request = testing.DummyRequest()
     settings = FilterConf.fromDict({"settings":{"str": u"<body>", "new": u"<body>Updated!"}})
     response = filterinc.replacestr(response, request, settings, request.url)
     self.assertTrue(response.unicode_body==u"<html><body>Updated!</body></html>", response.unicode_body)
Exemplo n.º 2
0
 def test_nosettings(self):
     response = testing.DummyRequest().response
     request = testing.DummyRequest()
     settings = FilterConf.fromDict({"settings":{"str": "", "new": ""}})
     response = filterinc.replacestr(response, request, settings, request.url)
     self.assertTrue(response.unicode_body==u"")
Exemplo n.º 3
0
 def test_empty(self):
     response = {}
     request = testing.DummyRequest()
     settings = FilterConf.fromDict({})
     response = filterinc.replacestr(response, request, settings, request.url)
     self.assertTrue(response=={})