def test_appropriate_prefixes_receive_dot_on_clean(self): for x in ['mr', 'Mrs', 'Ms', 'Dr', 'mdm']: a = EventGuest(pfx=x, first='FirstName', last='Last Name') a.clean() self.assertEqual(a.pfx[-1], '.') a.pfx = 'Miss' #make sure it doesn't dot everything. a.clean() self.assertNotEqual(a.pfx[-1], '.')
def test_cleaner_handles_nonetype(self): a = EventGuest(pfx=None, first='mitchell ') a.clean() self.assertEqual(a.pfx, None)
def test_names_and_pfxs_stripped_on_clean(self): a = EventGuest(pfx='mr. ', first='mitchell ', last=' stoutin') a.clean() self.assertEqual(a.pfx, 'mr.') self.assertEqual(a.first, 'mitchell') self.assertEqual(a.last, 'stoutin')