def test_render_internal_ip(self): req = HttpRequest() req.META["REMOTE_ADDR"] = "1.1.1.1" context = Context({"request": req}) r = KissMetricsNode().render(context) self.assertTrue(r.startswith("<!-- KISSmetrics 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 = KissMetricsNode().render(context) assert r.startswith('<!-- KISSmetrics 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 = KissMetricsNode().render(context) self.assertTrue(r.startswith( '<!-- KISSmetrics 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 = KissMetricsNode().render(context) self.assertTrue(r.startswith( '<!-- KISSmetrics disabled on internal IP address'), r) self.assertTrue(r.endswith('-->'), r)