#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# super ( TestTotals , self ) . setUp ( ) #NEWLINE# self . user = factories . User ( ) #NEWLINE# self . user2 = factories . User ( ) #NEWLINE# self . superuser = factories . Superuser ( ) #NEWLINE# permissions = Permission . objects . filter ( content_type = ContentType . objects . get_for_model ( Entry ) , codename__in = ( 'can_clock_in' , 'can_clock_out' , 'can_pause' , 'change_entry' ) ) #NEWLINE# self . user . user_permissions = permissions #NEWLINE# self . user2 . user_permissions = permissions #NEWLINE# self . user . save ( ) #NEWLINE# self . user2 . save ( ) #NEWLINE# self . activity = factories . Activity ( code = 'WRK' , name = 'Work' ) #NEWLINE# self . devl_activity = factories . Activity ( code = 'devl' , name = 'development' , billable = True ) #NEWLINE# self . sick_activity = factories . Activity ( code = 'sick' , name = 'sick/personal' , billable = False ) #NEWLINE# self . activity_group_all = factories . ActivityGroup ( name = 'All' ) #NEWLINE# self . activity_group_work = factories . ActivityGroup ( name = 'Client work' ) #NEWLINE# activities = Activity . objects . all ( ) #NEWLINE# for activity in activities : #NEWLINE# #INDENT# activity . activity_group . add ( self . activity_group_all ) #NEWLINE# if ( activity != self . sick_activity ) : #NEWLINE# #INDENT# activity . activity_group . add ( self . activity_group_work ) #NEWLINE# #UNINDENT# #UNINDENT# self . business = factories . Business ( ) #NEWLINE# status = factories . StatusAttribute ( label = 'Current' , enable_timetracking = True ) #NEWLINE# type_ = factories . TypeAttribute ( label = 'Web Sites' , enable_timetracking = True ) #NEWLINE# self . project = factories . Project ( type = type_ , status = status , business = self . business , point_person = self . user , activity_group = self . activity_group_work ) #NEWLINE# self . project2 = factories . Project ( type = type_ , status = status , business = self . business , point_person = self . user2 , activity_group = self . activity_group_all ) #NEWLINE# factories . ProjectRelationship ( user = self . user , project = self . project ) #NEWLINE# self . location = factories . Location ( ) #NEWLINE# self . p1 = factories . BillableProject ( name = '1' ) #NEWLINE# self . p2 = factories . NonbillableProject ( name = '2' ) #NEWLINE# self . p4 = factories . BillableProject ( name = '4' ) #NEWLINE# self . p3 = factories . NonbillableProject ( name = '1' )