Esempio n. 1
0
 def create_exercises(self):
     for i in range(NUM_EXERCISE_SUPER):
         super_category = ExerciseSuperCategory.objects.create(name='Super Category %s' % i)
         for j in range(NUM_EXERCISE_SUB):
             sub_category = ExerciseSubCategory.objects.create(
                 super_category=super_category,
                 name='Sub Category %s-%s' % (i, j),
             )
             for k in range(NUM_EXERCISE):
                 exercise = Exercise.objects.create(
                     sub_category=sub_category,
                     name='Exercise %s-%s-%s' % (i, j, k),
                 )
                 for c in range(random.randint(MIN_NUM_EXERCISE_STEPS, MAX_NUM_EXERCISE_STEPS)):
                     ExerciseStep.objects.create(
                         exercise=exercise,
                         step=c+1,
                         description='Step Description %s' % str(c+1),
                     )
                 for c in range(NUM_EXERCISE_VAR):
                     exercise_var = ExerciseVariation(
                         exercise=exercise,
                         name='Exercise Variation %s-%s-%s-%s' % (i, j, k, c),
                     )
                     exercise_var.save()
Esempio n. 2
0
class ExerciseTestData(WorkoutTestData):

    def setUp(self):
        super(ExerciseTestData, self).setUp()

        super_category = ExerciseSuperCategory.objects.create(name='Test Super Category')
        sub_category = ExerciseSubCategory.objects.create(
            super_category=super_category,
            name='Test Sub Category',
        )
        exercise = Exercise.objects.create(
            sub_category=sub_category,
            name='Test Exercise'
        )

        self.exercise_variation = ExerciseVariation(
            exercise=exercise,
            name='Test Exercise Variation',
        )
        self.exercise_variation.save()

    def tearDown(self):
        super(ExerciseTestData, self).tearDown()