예제 #1
0
 def test_update_exercise_info(self):
     user = User(username = '******', password = "******", email = '*****@*****.**')
     db.session.add(user)
     db.session.commit()
     
     exerciseTag1 = ExerciseTag(name="running", unit="minutes")
     workout = Workout(user.id, user.id, name="Get Fit Workout", 
                       description="This is the best way to shed those pounds!", level="Hard", 
                       is_public=True, is_likeable=True, is_commentable=True)
     
     exercise1 = Exercise(workOutId=workout.id, eTagId=exerciseTag1.id, order="1", amount="5", additionalInfo="No Additional Info")
     db.session.add(exerciseTag1)
     db.session.add(workout)
     Exercise.save_to_db(exercise1);
     
     
     exerciseFound = Exercise.find_by_id(exercise1.id)
     exerciseFound.amount = 10
     
     Exercise.update_exercise_info(exerciseFound)
     exerciseFound = Exercise.find_by_id(exercise1.id)
     assert exerciseFound.amount == 10