<s> import datetime <EOL> from decimal import Decimal <EOL> from random import randint <EOL> from django . contrib . auth . models import Permission <EOL> from django . db . models import Q <EOL> from django . utils import timezone <EOL> from timepiece import utils <EOL> from timepiece . entries . models import Entry <EOL> from timepiece . reports . tests . base import ReportsTestBase <EOL> from timepiece . reports . utils import get_project_totals , generate_dates <EOL> from timepiece . tests . base import ViewTestMixin , LogTimeMixin <EOL> class TestHourlyReport ( ViewTestMixin , LogTimeMixin , ReportsTestBase ) : <EOL> url_name = '<STR_LIT>' <EOL> def test_generate_months ( self ) : <EOL> dates = [ utils . add_timezone ( datetime . datetime ( <NUM_LIT> , month , <NUM_LIT:1> ) ) <EOL> for month in range ( <NUM_LIT:1> , <NUM_LIT> ) ] <EOL> start = datetime . date ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> end = datetime . date ( <NUM_LIT> , <NUM_LIT:12> , <NUM_LIT:1> ) <EOL> self . check_generate_dates ( start , end , '<STR_LIT>' , dates ) <EOL> def test_generate_weeks ( self ) : <EOL> dates = [ <EOL> utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:12> , <NUM_LIT> ) ) , <EOL> utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:3> ) ) , <EOL> utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:10> ) ) , <EOL> utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT> ) ) , <EOL> utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT> ) ) , <EOL> utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT> ) ) , <EOL> ] <EOL> start = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> end = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:2> , <NUM_LIT:1> ) ) <EOL> self . check_generate_dates ( start , end , '<STR_LIT>' , dates ) <EOL> def test_generate_days ( self ) : <EOL> dates = [ utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , day ) ) <EOL> for day in range ( <NUM_LIT:1> , <NUM_LIT:32> ) ] <EOL> start = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> end = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT> ) ) <EOL> self . check_generate_dates ( start , end , '<STR_LIT>' , dates ) <EOL> def check_truncs ( self , trunc , billable , non_billable ) : <EOL> self . make_entries ( user = self . user ) <EOL> self . make_entries ( user = self . user2 ) <EOL> entries = Entry . objects . date_trunc ( trunc ) <EOL> for entry in entries : <EOL> if entry [ '<STR_LIT>' ] : <EOL> self . assertEqual ( entry [ '<STR_LIT>' ] , billable ) <EOL> else : <EOL> self . assertEqual ( entry [ '<STR_LIT>' ] , non_billable ) <EOL> def test_trunc_month ( self ) : <EOL> self . check_truncs ( '<STR_LIT>' , <NUM_LIT> , <NUM_LIT:12> ) <EOL> def test_trunc_week ( self ) : <EOL> self . check_truncs ( '<STR_LIT>' , <NUM_LIT:6> , <NUM_LIT:4> ) <EOL> def test_trunc_day ( self ) : <EOL> self . check_truncs ( '<STR_LIT>' , <NUM_LIT:3> , <NUM_LIT:2> ) <EOL> def get_project_totals ( self , date_headers , trunc , query = Q ( ) , <EOL> hour_type = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> entries = Entry . objects . date_trunc ( trunc ) . filter ( query ) <EOL> if entries : <EOL> pj_totals = get_project_totals ( entries , date_headers , hour_type ) <EOL> pj_totals = list ( pj_totals ) <EOL> rows = pj_totals [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] <EOL> hours = [ hours for name , user_id , hours in rows ] <EOL> totals = pj_totals [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] <EOL> return hours , totals <EOL> else : <EOL> return '<STR_LIT>' <EOL> def log_daily ( self , start , day2 , end ) : <EOL> self . log_time ( project = self . p1 , start = start , delta = ( <NUM_LIT:1> , <NUM_LIT:0> ) ) <EOL> self . log_time ( project = self . p1 , start = day2 , delta = ( <NUM_LIT:0> , <NUM_LIT:30> ) ) <EOL> self . log_time ( project = self . p3 , start = day2 , delta = ( <NUM_LIT:1> , <NUM_LIT:0> ) ) <EOL> self . log_time ( project = self . p1 , start = day2 , delta = ( <NUM_LIT:3> , <NUM_LIT:0> ) , <EOL> user = self . user2 ) <EOL> self . log_time ( project = self . sick , start = end , delta = ( <NUM_LIT:2> , <NUM_LIT:0> ) , <EOL> user = self . user2 ) <EOL> def test_daily_total ( self ) : <EOL> start = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> day2 = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:2> ) ) <EOL> end = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:3> ) ) <EOL> self . log_daily ( start , day2 , end ) <EOL> trunc = '<STR_LIT>' <EOL> date_headers = generate_dates ( start , end , trunc ) <EOL> pj_totals = self . get_project_totals ( date_headers , trunc ) <EOL> self . assertEqual ( pj_totals [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] , <EOL> [ Decimal ( '<STR_LIT>' ) , Decimal ( '<STR_LIT>' ) , '<STR_LIT>' ] ) <EOL> self . assertEqual ( pj_totals [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] , <EOL> [ '<STR_LIT>' , Decimal ( '<STR_LIT>' ) , Decimal ( '<STR_LIT>' ) ] ) <EOL> self . assertEqual ( pj_totals [ <NUM_LIT:1> ] , <EOL> [ Decimal ( '<STR_LIT>' ) , Decimal ( '<STR_LIT>' ) , Decimal ( '<STR_LIT>' ) ] ) <EOL> def test_billable_nonbillable ( self ) : <EOL> start = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> day2 = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:2> ) ) <EOL> end = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:3> ) ) <EOL> self . log_daily ( start , day2 , end ) <EOL> trunc = '<STR_LIT>' <EOL> billableQ = Q ( project__type__billable = True ) <EOL> non_billableQ = Q ( project__type__billable = False ) <EOL> date_headers = generate_dates ( start , end , trunc ) <EOL> pj_billable = self . get_project_totals ( date_headers , trunc , Q ( ) , <EOL> '<STR_LIT>' ) <EOL> pj_billable_q = self . get_project_totals ( date_headers , trunc , billableQ , <EOL> '<STR_LIT>' ) <EOL> pj_non_billable = self . get_project_totals ( date_headers , trunc , Q ( ) , <EOL> '<STR_LIT>' ) <EOL> pj_non_billable_q = self . get_project_totals ( date_headers , trunc , <EOL> non_billableQ , '<STR_LIT>' ) <EOL> self . assertEqual ( list ( pj_billable ) , list ( pj_billable_q ) ) <EOL> self . assertEqual ( list ( pj_non_billable ) , list ( pj_non_billable_q ) ) <EOL> def test_weekly_total ( self ) : <EOL> start = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:3> ) ) <EOL> end = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:6> ) ) <EOL> self . bulk_entries ( start , end ) <EOL> trunc = '<STR_LIT>' <EOL> date_headers = generate_dates ( start , end , trunc ) <EOL> pj_totals = self . get_project_totals ( date_headers , trunc ) <EOL> self . assertEqual ( pj_totals [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] , [ <NUM_LIT> ] ) <EOL> self . assertEqual ( pj_totals [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] , [ <NUM_LIT> ] ) <EOL> self . assertEqual ( pj_totals [ <NUM_LIT:1> ] , [ <NUM_LIT> ] ) <EOL> def test_monthly_total ( self ) : <EOL> start = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> end = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , <NUM_LIT:3> , <NUM_LIT:1> ) ) <EOL> trunc = '<STR_LIT>' <EOL> last_day = randint ( <NUM_LIT:5> , <NUM_LIT:10> ) <EOL> worked1 = randint ( <NUM_LIT:1> , <NUM_LIT:3> ) <EOL> worked2 = randint ( <NUM_LIT:1> , <NUM_LIT:3> ) <EOL> for month in range ( <NUM_LIT:1> , <NUM_LIT:7> ) : <EOL> for day in range ( <NUM_LIT:1> , last_day + <NUM_LIT:1> ) : <EOL> day = utils . add_timezone ( datetime . datetime ( <NUM_LIT> , month , day ) ) <EOL> self . log_time ( start = day , delta = ( worked1 , <NUM_LIT:0> ) , user = self . user ) <EOL> self . log_time ( start = day , delta = ( worked2 , <NUM_LIT:0> ) , user = self . user2 ) <EOL> date_headers = generate_dates ( start , end , trunc ) <EOL> pj_totals = self . get_project_totals ( date_headers , trunc ) <EOL> for hour in pj_totals [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] : <EOL> self . assertEqual ( hour , last_day * worked1 ) <EOL> for hour in pj_totals [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] : <EOL> self . assertEqual ( hour , last_day * worked2 ) <EOL> def args_helper ( self , ** kwargs ) : <EOL> start = utils . add_timezone ( kwargs . pop ( '<STR_LIT:start>' , datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:2> ) ) ) <EOL> end = utils . add_timezone ( kwargs . pop ( '<STR_LIT:end>' , datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:4> ) ) ) <EOL> defaults = { <EOL> '<STR_LIT>' : start . strftime ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : end . strftime ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> defaults . update ( kwargs ) <EOL> return defaults <EOL> def make_totals ( self , args = { } ) : <EOL> """<STR_LIT>""" <EOL> self . login_user ( self . superuser ) <EOL> response = self . _get ( data = args , follow = True ) <EOL> return [ item . split ( '<STR_LIT:U+002C>' ) <EOL> for item in response . content . decode ( '<STR_LIT:utf-8>' ) . split ( '<STR_LIT:\r\n>' ) ] [ : - <NUM_LIT:1> ] <EOL> def check_totals ( self , args , data ) : <EOL> """<STR_LIT>""" <EOL> totals = self . make_totals ( args ) <EOL> for row , datum in zip ( totals , data ) : <EOL> self . assertEqual ( row [ <NUM_LIT:1> : ] , datum ) <EOL> def test_form_type__none ( self ) : <EOL> """<STR_LIT>""" <EOL> self . bulk_entries ( ) <EOL> args = { '<STR_LIT>' : False , '<STR_LIT>' : False , '<STR_LIT>' : False } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ ] <EOL> self . check_totals ( args , data ) <EOL> def test_form_type__all ( self ) : <EOL> """<STR_LIT>""" <EOL> self . bulk_entries ( ) <EOL> args = { '<STR_LIT>' : True , '<STR_LIT>' : True , '<STR_LIT>' : True } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . check_totals ( args , data ) <EOL> def test_form_type__exclude_billable ( self ) : <EOL> """<STR_LIT>""" <EOL> self . bulk_entries ( ) <EOL> args = { '<STR_LIT>' : False , '<STR_LIT>' : True , '<STR_LIT>' : True } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . check_totals ( args , data ) <EOL> def test_form_type__exclude_nonbillable ( self ) : <EOL> """<STR_LIT>""" <EOL> self . bulk_entries ( ) <EOL> args = { '<STR_LIT>' : True , '<STR_LIT>' : False , '<STR_LIT>' : True } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . check_totals ( args , data ) <EOL> def test_form_type__exclude_leave ( self ) : <EOL> """<STR_LIT>""" <EOL> self . bulk_entries ( ) <EOL> args = { '<STR_LIT>' : True , '<STR_LIT>' : True , '<STR_LIT>' : False } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . check_totals ( args , data ) <EOL> def test_form_type__only_billable ( self ) : <EOL> """<STR_LIT>""" <EOL> self . bulk_entries ( ) <EOL> args = { '<STR_LIT>' : True , '<STR_LIT>' : False , '<STR_LIT>' : False } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . check_totals ( args , data ) <EOL> def test_form_type__only_nonbillable ( self ) : <EOL> """<STR_LIT>""" <EOL> self . bulk_entries ( ) <EOL> args = { '<STR_LIT>' : False , '<STR_LIT>' : True , '<STR_LIT>' : False } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . check_totals ( args , data ) <EOL> def test_form_type__only_leave ( self ) : <EOL> """<STR_LIT>""" <EOL> self . bulk_entries ( ) <EOL> args = { '<STR_LIT>' : False , '<STR_LIT>' : False , '<STR_LIT>' : True } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . check_totals ( args , data ) <EOL> def test_form_day ( self ) : <EOL> """<STR_LIT>""" <EOL> args = { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . bulk_entries ( ) <EOL> self . check_totals ( args , data ) <EOL> def test_form_week ( self ) : <EOL> """<STR_LIT>""" <EOL> args = { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . bulk_entries ( ) <EOL> self . check_totals ( args , data ) <EOL> def test_form_month ( self ) : <EOL> """<STR_LIT>""" <EOL> tz = timezone . get_current_timezone ( ) <EOL> start = datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:4> , tzinfo = tz ) <EOL> end = datetime . datetime ( <NUM_LIT> , <NUM_LIT:3> , <NUM_LIT> , tzinfo = tz ) <EOL> args = { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> args = self . args_helper ( start = start , end = end , ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . bulk_entries ( start , end ) <EOL> self . check_totals ( args , data ) <EOL> def test_form_projects ( self ) : <EOL> """<STR_LIT>""" <EOL> self . bulk_entries ( ) <EOL> args = { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : self . p1 . id , <EOL> } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . check_totals ( args , data ) <EOL> args = { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : self . p2 . id , <EOL> } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . check_totals ( args , data ) <EOL> args = { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ self . p2 . id , self . p4 . id ] , <EOL> } <EOL> args = self . args_helper ( ** args ) <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> self . check_totals ( args , data ) <EOL> def test_no_permission ( self ) : <EOL> """<STR_LIT>""" <EOL> self . login_user ( self . user ) <EOL> response = self . _get ( ) <EOL> self . assertEqual ( response . status_code , <NUM_LIT> ) <EOL> def test_entry_summary_permission ( self ) : <EOL> """<STR_LIT>""" <EOL> self . login_user ( self . user ) <EOL> entry_summ_perm = Permission . objects . get ( codename = '<STR_LIT>' ) <EOL> self . user . user_permissions . add ( entry_summ_perm ) <EOL> self . user . save ( ) <EOL> response = self . _get ( ) <EOL> self . assertEqual ( response . status_code , <NUM_LIT:200> ) </s>
