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