Exemplo n.º 1
0
 def test_render_internal_ip(self):
     req = HttpRequest()
     req.META["REMOTE_ADDR"] = "1.1.1.1"
     context = Context({"request": req})
     r = ChartbeatBottomNode().render(context)
     self.assertTrue(r.startswith("<!-- Chartbeat disabled on internal IP address"), r)
     self.assertTrue(r.endswith("-->"), r)
 def test_render_internal_ip(self):
     req = HttpRequest()
     req.META['REMOTE_ADDR'] = '1.1.1.1'
     context = Context({'request': req})
     r = ChartbeatBottomNode().render(context)
     assert r.startswith('<!-- Chartbeat disabled on internal IP address')
     assert r.endswith('-->')
 def test_render_internal_ip(self):
     req = HttpRequest()
     req.META['REMOTE_ADDR'] = '1.1.1.1'
     context = Context({'request': req})
     r = ChartbeatBottomNode().render(context)
     self.assertTrue(r.startswith(
             '<!-- Chartbeat disabled on internal IP address'), r)
     self.assertTrue(r.endswith('-->'), r)
 def test_render_internal_ip(self):
     self.settings_manager.set(ANALYTICAL_INTERNAL_IPS=['1.1.1.1'])
     req = HttpRequest()
     req.META['REMOTE_ADDR'] = '1.1.1.1'
     context = Context({'request': req})
     r = ChartbeatBottomNode().render(context)
     self.assertTrue(
         r.startswith('<!-- Chartbeat disabled on internal IP address'), r)
     self.assertTrue(r.endswith('-->'), r)