Пример #1
0
 def save(self):
     if self.is_valid():
         skills = Skills(self.request)
         skills.save_skills(self.skills)
         skills.save_desired_level(self.desired_level)
         skills.save_multiplier(self.multiplier)
         skills.save_fill_skills(self.fill_skills)
     else:
         raise SkillsValidationError(self.errors)
Пример #2
0
    def test_skills_save_properties_to_session(self):
        request = self.FakeRequest()
        skills = Skills(request)
        skills.save_skills({"some"})
        skills.save_desired_level(1)
        skills.save_multiplier(1.5)
        skills.save_fill_skills("true")

        self.assertDictEqual(
            request.session, {
                "skills": {"some"},
                "desired_level": 1,
                "multiplier": 1.5,
                "fill_skills": "true"
            })