<s> """<STR_LIT>""" <EOL> from django . http import HttpRequest <EOL> from django . template import Context <EOL> from django . test . utils import override_settings <EOL> from analytical . templatetags . clickmap import ClickmapNode <EOL> from analytical . tests . utils import TagTestCase <EOL> from analytical . utils import AnalyticalException <EOL> @ override_settings ( CLICKMAP_TRACKER_ID = '<STR_LIT>' ) <EOL> class ClickmapTagTestCase ( TagTestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_tag ( self ) : <EOL> r = self . render_tag ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertTrue ( "<STR_LIT>" in r , r ) <EOL> def test_node ( self ) : <EOL> r = ClickmapNode ( ) . render ( Context ( { } ) ) <EOL> self . assertTrue ( "<STR_LIT>" in r , r ) <EOL> @ override_settings ( CLICKMAP_TRACKER_ID = None ) <EOL> def test_no_site_id ( self ) : <EOL> self . assertRaises ( AnalyticalException , ClickmapNode ) <EOL> @ override_settings ( CLICKMAP_TRACKER_ID = '<STR_LIT>' ) <EOL> def test_wrong_site_id ( self ) : <EOL> self . assertRaises ( AnalyticalException , ClickmapNode ) <EOL> @ override_settings ( ANALYTICAL_INTERNAL_IPS = [ '<STR_LIT>' ] ) <EOL> def test_render_internal_ip ( self ) : <EOL> req = HttpRequest ( ) <EOL> req . META [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> context = Context ( { '<STR_LIT>' : req } ) <EOL> r = ClickmapNode ( ) . render ( context ) <EOL> self . assertTrue ( r . startswith ( <EOL> '<STR_LIT>' ) , r ) <EOL> self . assertTrue ( r . endswith ( '<STR_LIT>' ) , r ) </s>
