Module ImportFrom alias ImportFrom alias TryExcept body Import alias identifier handlers ExceptHandler type NameLoad body Import alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias ClassDef bases NameLoad body Assign NameStore ListLoad Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr For NameStore Call NameLoad Num body Assign NameStore BinOpSub Call AttributeLoad NameLoad attr Call NameLoad keyword BinOpMult NameLoad Num With Call AttributeLoad NameLoad attr Str NameStore body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str Assign NameStore Call AttributeLoad Call NameLoad Str attr Call NameLoad Dict Str NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Num NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad Str attr Call NameLoad Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad Str attr Call NameLoad Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad Str attr Call NameLoad Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad Str attr Call NameLoad Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad Str attr Call NameLoad Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad Str attr Call NameLoad Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad Str attr Call NameLoad Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad Str attr Call NameLoad Dict Str AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad Str attr Call NameLoad Dict Str AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Lambda arguments args NameParam NameParam defaults Call AttributeLoad Call NameLoad NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Dict Str Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Lambda arguments args NameParam NameParam defaults Call AttributeLoad Call NameLoad NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Dict Str Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Lambda arguments args NameParam NameParam defaults Call AttributeLoad Call NameLoad NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Dict Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Dict Str Str decorator_list decorator_list
N/A __future__ unicode_literals datetime timedelta N/A N/A N/A unittest.mock mock N/A N/A N/A ImportError N/A N/A mock django.test TestCase django.template Template Context TemplateSyntaxError django.utils timezone hitcount.models Hit HitCount blog.models Post TemplateTagGetHitCountTests N/A TestCase N/A N/A fixtures N/A initial_data.json setUp N/A N/A self N/A N/A N/A N/A self post N/A N/A N/A Post objects get pk 1 N/A hit_count N/A N/A N/A HitCount objects create content_object N/A self post N/A x N/A range 10 N/A N/A created N/A N/A N/A timezone now N/A timedelta minutes N/A x 15 N/A N/A N/A mock patch django.utils.timezone.now mock_now N/A N/A N/A mock_now return_value created N/A N/A N/A N/A Hit objects create hitcount hit_count N/A test_returns_0 N/A N/A self N/A N/A N/A 
        {% get_hit_count for post%}

        If no HitCount object exists, the template tag should return zero
        and have created an object for the next time.
         N/A N/A N/A self assertEqual N/A len N/A N/A N/A HitCount objects all 1 N/A post2 N/A N/A N/A Post objects create title second content post! N/A out N/A N/A N/A Template {% load hitcount_tags %}{% get_hit_count for post %} render N/A Context N/A post post2 N/A N/A N/A self assertEqual N/A str 0 out N/A N/A N/A self assertEqual N/A len N/A N/A N/A HitCount objects all 2 N/A test_returns_10 N/A N/A self N/A N/A N/A 
        {% get_hit_count for post%}

        Test tag with multiple hits.
         N/A out N/A N/A N/A Template {% load hitcount_tags %}{% get_hit_count for post %} render N/A Context N/A post N/A self post N/A N/A N/A self assertEqual N/A str 10 out N/A test_as_variable N/A N/A self N/A N/A N/A 
        {% get_hit_count for post as hits %}

        Test tag with output as variable.
         N/A out N/A N/A N/A Template {% load hitcount_tags %}{% get_hit_count for post as hits %}Total Hits: {{ hits }} render N/A Context N/A post N/A self post N/A N/A N/A self assertEqual Total Hits: 10 out N/A test_within N/A N/A self N/A N/A N/A 
        {% get_hit_count for [object] within [ex: "hours=1"] %}

        Test tag with multiple hits.
         N/A out N/A N/A N/A Template {% load hitcount_tags %}{% get_hit_count for post within "hours=1" %} render N/A Context N/A post N/A self post N/A N/A N/A self assertEqual N/A str 4 out N/A test_within_multiple_time_args N/A N/A self N/A N/A N/A 
        {% get_hit_count for [object] within [ex: "hours=1,minutes=30"] %}

        Test tag with multiple hits and multiple time args.
         N/A out N/A N/A N/A Template {% load hitcount_tags %}{% get_hit_count for post within "hours=1,minutes=30" %} render N/A Context N/A post N/A self post N/A N/A N/A self assertEqual N/A str 6 out N/A test_within_multiple_time_args_without_quotes N/A N/A self N/A N/A N/A 
        {% get_hit_count for [object] within [ex: hours=1,minutes=30] %}

        Test tag with multiple hits and multiple time args without quotes.
         N/A out N/A N/A N/A Template {% load hitcount_tags %}{% get_hit_count for post within hours=1,minutes=30 %} render N/A Context N/A post N/A self post N/A N/A N/A self assertEqual N/A str 6 out N/A test_within_as_var N/A N/A self N/A N/A N/A 
        {% get_hit_count for [object] within [ex: "hours=1"] as [var] %}

        Test tag with multiple hits, get as a variable.
         N/A out N/A N/A N/A Template {% load hitcount_tags %}{% get_hit_count for post within "hours=1" as hits %}Total Hits in last hour: {{ hits }} render N/A Context N/A post N/A self post N/A N/A N/A self assertEqual Total Hits in last hour: 4 out N/A test_within_multiple_time_args_as_var N/A N/A self N/A N/A N/A 
        {% get_hit_count for [object] within [ex: "hours=1,minutes=30"] as [var] %}

        Test tag with multiple hits and multiple time args as a variable.
         N/A out N/A N/A N/A Template {% load hitcount_tags %}{% get_hit_count for post within "hours=1,minutes=30" as hits %}Total Hits in last 1h 15m: {{ hits }} render N/A Context N/A post N/A self post N/A N/A N/A self assertEqual Total Hits in last 1h 15m: 6 out N/A test_get_js_variables N/A N/A self N/A N/A N/A 
        {% get_hit_count_js_variables for [object] as [var_name] %}

        Test retrieval of javascript variables.
         N/A out N/A N/A N/A Template {% load hitcount_tags %}{% get_hit_count_js_variables for post as hit_count_js %}pk: {{ hit_count_js.pk }} || url: {{ hit_count_js.ajax_url }} || hits: {{ hit_count_js.hits }} render N/A Context N/A post N/A self post N/A pk N/A N/A N/A self post hit_count pk N/A N/A N/A self assertEqual N/A pk: %s || url: /hitcount/hit/ajax/ || hits: 10 pk out N/A test_insert_js_variables N/A N/A self N/A N/A N/A 
        {% insert_hit_count_js_variables for [object] %}

        Test for writing of js variables directly onto the template.
         N/A out N/A N/A N/A Template {% load hitcount_tags %}{% insert_hit_count_js_variables for post %} render N/A Context N/A post N/A self post N/A pk N/A N/A N/A self post hit_count pk N/A N/A N/A self assertEqual N/A <script type="text/javascript">
var hitcountJS = {hitcountPK : '%s',hitcountURL : '/hitcount/hit/ajax/'};
</script> pk out N/A test_parsing_errors N/A N/A self N/A N/A N/A render N/A N/A N/A t c N/A N/A N/A N/A Template t render N/A Context c N/A N/A N/A self assertRaises TemplateSyntaxError render {% load hitcount_tags %}{% get_hit_count for post within "foo=1,bar=30" %} N/A post N/A self post N/A N/A N/A self assertRaises TemplateSyntaxError render {% load hitcount_tags %}{% get_hit_count for post %} N/A post_doesnt_context N/A self post N/A N/A N/A self assertRaises TemplateSyntaxError render {% load hitcount_tags %}{% get_hit_count post %} N/A post N/A self post N/A N/A N/A self assertRaises TemplateSyntaxError render {% load hitcount_tags %}{% get_hit_count post %} N/A post bob the baker N/A test_parsing_errors_get_js_variables N/A N/A self N/A N/A N/A render N/A N/A N/A t c N/A N/A N/A N/A Template t render N/A Context c N/A N/A N/A self assertRaises TemplateSyntaxError render {% load hitcount_tags %}{% get_hit_count_js_variables as hit_count_js %} N/A post_variable_wrong N/A self post N/A N/A N/A self assertRaises TemplateSyntaxError render {% load hitcount_tags %}{% get_hit_count_js_variables as hit_count_js %} N/A post N/A self post N/A N/A N/A self assertRaises TemplateSyntaxError render {% load hitcount_tags %}{% get_hit_count_js_variables for post as hit_count_js %} N/A post bob the baker N/A test_parsing_errors_insert_js_variables N/A N/A self N/A N/A N/A render N/A N/A N/A t c N/A N/A N/A N/A Template t render N/A Context c N/A N/A N/A self assertRaises TemplateSyntaxError render {% load hitcount_tags %}{% insert_hit_count_js_variables post %} N/A post N/A self post N/A N/A N/A self assertRaises TemplateSyntaxError render {% load hitcount_tags %}{% insert_hit_count_js_variables for post %} N/A post_doesnt_context N/A self post N/A N/A N/A self assertRaises TemplateSyntaxError render {% load hitcount_tags %}{% insert_hit_count_js_variables for post %} N/A post bob the baker N/A N/A