def add_walker(business, walker_name): b, created = Business.objects.get_or_create(business_name=business) if created: b.save() w = Walker(walker_name=walker_name, business=b) w.save() return w
def test_cannot_save_empty_walker_names(self): walker = Walker(walker_name='') with self.assertRaises(ValidationError): walker.save() walker.full_clean()
def test_default_text(self): walker = Walker() self.assertEqual(walker.walker_name, '')