예제 #1
0
파일: models.py 프로젝트: OscarPDR/lunchman
    def save(self, *args, **kwargs):

        self.meal = fix_meal_name(self.meal)

        super(FirstCourse, self).save(*args, **kwargs)
예제 #2
0
파일: models.py 프로젝트: OscarPDR/lunchman
    def save(self, *args, **kwargs):

        self.meal = fix_meal_name(self.meal)

        super(Dessert, self).save(*args, **kwargs)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 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)
예제 #6
0
 def test_fix_spaces(self):
     original_value = u' Lorem ipsum '
     desired_value = u'Lorem ipsum'
     self.assertEqual(fix_meal_name(original_value), desired_value)