def save(self, *args, **kwargs): self.meal = fix_meal_name(self.meal) super(FirstCourse, self).save(*args, **kwargs)
def save(self, *args, **kwargs): self.meal = fix_meal_name(self.meal) super(Dessert, self).save(*args, **kwargs)
def test_fix_full(self): original_value = u' Lorem c/ipsum / Dolor sit amet ' desired_value = u'Lorem con ipsum' self.assertEqual(fix_meal_name(original_value), desired_value)
def test_fix_with(self): original_value = u'Lorem c/ipsum' desired_value = u'Lorem con ipsum' self.assertEqual(fix_meal_name(original_value), desired_value)
def test_fix_attached_slash(self): original_value = u'Lorem ipsum/Dolor sit amet ' desired_value = u'Lorem ipsum' self.assertEqual(fix_meal_name(original_value), desired_value)
def test_fix_spaces(self): original_value = u' Lorem ipsum ' desired_value = u'Lorem ipsum' self.assertEqual(fix_meal_name(original_value), desired_value)