Ejemplo n.º 1
0
 def predict_desired_level(self, request):
     skill = Skills(request)
     target_level = skill.get_desired_level()
     if self.default_level < target_level and self.fill_skills:
         self.set_skills_to_desired_level(target_level)
         return target_level
     else:
         return self.predict_level("desired")
Ejemplo n.º 2
0
 def test_have_default_desired_level(self):
     request = self.FakeRequest()
     skills = Skills(request)
     self.assertEqual(skills.get_desired_level(), 1)
Ejemplo n.º 3
0
 def test_can_get_desired_level(self):
     request = self.FakeRequest()
     request.session.update({"desired_level": 1})
     skills = Skills(request)
     self.assertEqual(skills.get_desired_level(), 1)