Ejemplo n.º 1
0
    object_class = ContractOption
    url = 'gym:contract-option:delete'
    user_success = ('manager1',
                    'manager2')
    user_fail = ('admin',
                 'general_manager1',
                 'manager3',
                 'manager4',
                 'test',
                 'member1',
                 'member2',
                 'member3',
                 'member4',
                 'member5')

delete_testcase_add_methods(DeleteContractOptionTestCase)


class AccessContractOptionOverviewTestCase(WorkoutManagerAccessTestCase):
    '''
    Test accessing the contract option page
    '''
    url = reverse('gym:contract-option:list', kwargs={'gym_pk': 1})
    user_success = ('manager1',
                    'manager2')
    user_fail = ('admin',
                 'general_manager1',
                 'manager3',
                 'manager4',
                 'test',
                 'member1',
Ejemplo n.º 2
0
    user_success = ('manager1', 'manager2')
    user_fail = ('admin', 'general_manager1', 'manager3', 'manager4', 'test',
                 'member1', 'member2', 'member3', 'member4', 'member5')
    data = {'name': 'Standard contract 16-Gj'}


class DeleteContractOptionTestCase(WorkoutManagerDeleteTestCase):
    '''
    Tests deleting a contract option
    '''

    pk = 1
    object_class = ContractOption
    url = 'gym:contract-option:delete'
    user_success = ('manager1', 'manager2')
    user_fail = ('admin', 'general_manager1', 'manager3', 'manager4', 'test',
                 'member1', 'member2', 'member3', 'member4', 'member5')


delete_testcase_add_methods(DeleteContractOptionTestCase)


class AccessContractOptionOverviewTestCase(WorkoutManagerAccessTestCase):
    '''
    Test accessing the contract option page
    '''
    url = reverse('gym:contract-option:list', kwargs={'gym_pk': 1})
    user_success = ('manager1', 'manager2')
    user_fail = ('admin', 'general_manager1', 'manager3', 'manager4', 'test',
                 'member1', 'member2', 'member3', 'member4', 'member5')
Ejemplo n.º 3
0

class EditAdminNoteTestCase(WorkoutManagerEditTestCase):
    '''
    Tests editing an admin note
    '''

    object_class = AdminUserNote
    url = 'gym:admin_note:edit'
    pk = 1
    user_success = ('trainer1', 'trainer2', 'trainer3')
    user_fail = ('member1', 'manager1', 'manager2', 'trainer4',
                 'general_manager1', 'general_manager2')
    data = {'note': 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr'}


class DeleteAdminNoteTestCase(WorkoutManagerDeleteTestCase):
    '''
    Tests deleting an admin note
    '''

    pk = 2
    object_class = AdminUserNote
    url = 'gym:admin_note:delete'
    user_success = ('trainer1', 'trainer2', 'trainer3')
    user_fail = ('member1', 'manager1', 'manager2', 'trainer4',
                 'general_manager1', 'general_manager2')


delete_testcase_add_methods(DeleteAdminNoteTestCase)
Ejemplo n.º 4
0
    object_class = ContractType
    url = 'gym:contract_type:delete'
    user_success = ('manager1',
                    'manager2')
    user_fail = ('admin',
                 'general_manager1',
                 'manager3',
                 'manager4',
                 'test',
                 'member1',
                 'member2',
                 'member3',
                 'member4',
                 'member5')

delete_testcase_add_methods(DeleteContractTypeTestCase)


class AccessContractTypeOverviewTestCase(WorkoutManagerAccessTestCase):
    '''
    Test accessing the contract list page
    '''
    url = reverse('gym:contract_type:list', kwargs={'gym_pk': 1})
    user_success = ('manager1',
                    'manager2')
    user_fail = ('admin',
                 'general_manager1',
                 'manager3',
                 'manager4',
                 'test',
                 'member1',
Ejemplo n.º 5
0
    pk = 2
    object_class = Gym
    url = 'gym:gym:delete'
    user_success = ('admin',
                    'general_manager1',
                    'general_manager2')
    user_fail = ('member1',
                 'member2',
                 'trainer2',
                 'trainer3',
                 'trainer4',
                 'manager1',
                 'manager3')

delete_testcase_add_methods(DeleteGymTestCase)


class EditGymTestCase(WorkoutManagerEditTestCase):
    '''
    Tests editing a gym
    '''

    object_class = Gym
    url = 'gym:gym:edit'
    pk = 1
    data = {'name': 'A different name'}
    user_success = ('admin',
                    'manager1',
                    'general_manager1',
                    'general_manager2')
Ejemplo n.º 6
0
    data = {'name': 'Petersilie'}
    user_success = ('trainer1',
                    'trainer2',
                    'trainer3')
    user_fail = ('member1',
                 'member2',
                 'trainer4',
                 'manager3',
                 'general_manager1')


class DeleteDocumentTestCase(WorkoutManagerDeleteTestCase):
    '''
    Tests deleting a user document
    '''

    pk = 1
    object_class = UserDocument
    url = 'gym:document:delete'
    user_success = ('admin',
                    'trainer1',
                    'trainer2',
                    'trainer3')
    user_fail = ('member1',
                 'member2',
                 'trainer4',
                 'manager3',
                 'general_manager1')

delete_testcase_add_methods(DeleteDocumentTestCase)
Ejemplo n.º 7
0
    user_success = ('manager1', 'manager2')
    user_fail = ('admin', 'general_manager1', 'manager3', 'manager4', 'test',
                 'member1', 'member2', 'member3', 'member4', 'member5')
    data = {'name': 'Standard contract 16-Gj'}


class DeleteContractTypeTestCase(WorkoutManagerDeleteTestCase):
    '''
    Tests deleting a contract type
    '''

    pk = 1
    object_class = ContractType
    url = 'gym:contract_type:delete'
    user_success = ('manager1', 'manager2')
    user_fail = ('admin', 'general_manager1', 'manager3', 'manager4', 'test',
                 'member1', 'member2', 'member3', 'member4', 'member5')


delete_testcase_add_methods(DeleteContractTypeTestCase)


class AccessContractTypeOverviewTestCase(WorkoutManagerAccessTestCase):
    '''
    Test accessing the contract list page
    '''
    url = reverse('gym:contract_type:list', kwargs={'gym_pk': 1})
    user_success = ('manager1', 'manager2')
    user_fail = ('admin', 'general_manager1', 'manager3', 'manager4', 'test',
                 'member1', 'member2', 'member3', 'member4', 'member5')
Ejemplo n.º 8
0

class DeleteGymTestCase(WorkoutManagerDeleteTestCase):
    '''
    Tests deleting a gym
    '''

    pk = 2
    object_class = Gym
    url = 'gym:gym:delete'
    user_success = ('admin', 'general_manager1', 'general_manager2')
    user_fail = ('member1', 'member2', 'trainer2', 'trainer3', 'trainer4',
                 'manager1', 'manager3')


delete_testcase_add_methods(DeleteGymTestCase)


class EditGymTestCase(WorkoutManagerEditTestCase):
    '''
    Tests editing a gym
    '''

    object_class = Gym
    url = 'gym:gym:edit'
    pk = 1
    data = {'name': 'A different name'}
    user_success = ('admin', 'manager1', 'general_manager1',
                    'general_manager2')
    user_fail = ('member1', 'member2', 'trainer2', 'trainer3', 'trainer4',
                 'manager3')
Ejemplo n.º 9
0
                    'trainer2',
                    'trainer3')
    user_fail = ('member1',
                 'manager1',
                 'manager2',
                 'trainer4',
                 'general_manager1',
                 'general_manager2')
    data = {'note': 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr'}


class DeleteAdminNoteTestCase(WorkoutManagerDeleteTestCase):
    '''
    Tests deleting a gym
    '''

    pk = 2
    object_class = AdminUserNote
    url = 'gym:admin_note:delete'
    user_success = ('trainer1',
                    'trainer2',
                    'trainer3')
    user_fail = ('member1',
                 'manager1',
                 'manager2',
                 'trainer4',
                 'general_manager1',
                 'general_manager2')

delete_testcase_add_methods(DeleteAdminNoteTestCase)
Ejemplo n.º 10
0

class EditDocumentTestCase(WorkoutManagerEditTestCase):
    '''
    Tests editing a user document
    '''

    pk = 2
    object_class = UserDocument
    url = 'gym:document:edit'
    data = {'name': 'Petersilie'}
    user_success = ('trainer1', 'trainer2', 'trainer3')
    user_fail = ('member1', 'member2', 'trainer4', 'manager3',
                 'general_manager1')


class DeleteDocumentTestCase(WorkoutManagerDeleteTestCase):
    '''
    Tests deleting a user document
    '''

    pk = 1
    object_class = UserDocument
    url = 'gym:document:delete'
    user_success = ('admin', 'trainer1', 'trainer2', 'trainer3')
    user_fail = ('member1', 'member2', 'trainer4', 'manager3',
                 'general_manager1')


delete_testcase_add_methods(DeleteDocumentTestCase)