示例#1
0
def _init_client(logged=False, role=None):
    client = Client()
    profile = None
    if logged:
        if not role:
            raise AttributeError('Role is not specified!')
        prof_gen = UserProfileGenerator()
        prof_gen.generate(role)
        profile = UserProfile.objects.filter(user__groups__name=role).first()
        client.login(username=profile.get_username(), password='******')
    return client, profile
示例#2
0
def _init_client(logged=False, role=None):
    client = Client()
    profile = None
    if logged:
        if not role:
            raise AttributeError('Role is not specified!')
        prof_gen = UserProfileGenerator()
        prof_gen.generate(role)
        profile = UserProfile.objects.filter(
            user__groups__name=role).first()
        client.login(username=profile.get_username(), password='******')
    return client, profile
示例#3
0
    def setUp(self):
        gen_us = UserProfileGenerator()
        gen_us.generate(UserProfileGenerator.ANIMATOR, 4)
        gen_us.generate(UserProfileGenerator.PHOTOGRAPHER, 2)
        gen_serv = AdditionalServicesGenerator()
        gen_serv.generate()

        self.data = {
            'title': 'Супер-пупер сервис',
            'num_executors': 2,
            'possible_executors': UserProfile.objects.all_executors()[:4],
            'price': 555000
        }
示例#4
0
    def setUp(self):
        gen_us = UserProfileGenerator()
        gen_us.generate(UserProfileGenerator.ANIMATOR, 4)
        gen_us.generate(UserProfileGenerator.PHOTOGRAPHER, 2)
        gen_prog = ProgramGenerator()
        gen_prog.generate(8)

        self.data = {
            'title': 'Наркоман и Гномик',
            'characters': 'Наркоман, Гномик',
            'num_executors': 2,
            'possible_executors': UserProfile.objects.all_executors()[:4],
        }
示例#5
0
    def setUp(self):
        gen_us = UserProfileGenerator()
        gen_us.generate(UserProfileGenerator.ANIMATOR, 4)
        gen_us.generate(UserProfileGenerator.PHOTOGRAPHER, 2)
        gen_serv = AdditionalServicesGenerator()
        gen_serv.generate()

        self.data = {
            'title': 'Супер-пупер сервис',
            'num_executors': 2,
            'possible_executors': UserProfile.objects.all_executors()[:4],
            'price': 555000
        }
示例#6
0
    def setUp(self):
        gen_us = UserProfileGenerator()
        gen_us.generate(UserProfileGenerator.ANIMATOR, 4)
        gen_us.generate(UserProfileGenerator.PHOTOGRAPHER, 2)
        gen_prog = ProgramGenerator()
        gen_prog.generate(8)

        self.data = {
            'title': 'Наркоман и Гномик',
            'characters': 'Наркоман, Гномик',
            'num_executors': 2,
            'possible_executors': UserProfile.objects.all_executors()[:4],
        }
示例#7
0
    def setUp(self):
        from orders_manager.models import UserProfile
        from orders_manager.roles import init_roles

        init_roles()
        gen_us = UserProfileGenerator()
        gen_us.generate(UserProfileGenerator.ANIMATOR, 4)
        user_profiles = UserProfile.objects.all()
        user_profile = UserProfile.objects.first()
        self.day_off_data = {
            'user_id': user_profile.user.id,
            'date': '2015-12-03',
            'time_start': '10:00:00',
            'time_end': '15:00:00'
        }
示例#8
0
    def setUp(self):
        from orders_manager.models import UserProfile
        from orders_manager.roles import init_roles

        init_roles()
        gen_us = UserProfileGenerator()
        gen_us.generate(UserProfileGenerator.ANIMATOR, 4)
        user_profiles = UserProfile.objects.all()
        user_profile = UserProfile.objects.first()
        self.day_off_data = {
            'user_id': user_profile.user.id,
            'date': '2015-12-03',
            'time_start': '10:00:00',
            'time_end': '15:00:00'
        }
示例#9
0
 def setUp(self):
     init_roles()
     us_gen = UserProfileGenerator()
     us_gen.generate(role=UserProfileGenerator.ANIMATOR, num=5)
     us_gen.generate(role=UserProfileGenerator.MANAGER, num=3)
     us_gen.generate(role=UserProfileGenerator.PHOTOGRAPHER, num=1)
示例#10
0
 def setUp(self):
     init_roles()
     us_gen = UserProfileGenerator()
     us_gen.generate(role=UserProfileGenerator.ANIMATOR, num=5)
     us_gen.generate(role=UserProfileGenerator.MANAGER, num=3)
     us_gen.generate(role=UserProfileGenerator.PHOTOGRAPHER, num=1)