def test_first_and_last_name(self): student = utils.Student(1, '0000', None, 'John', 'Doe', '*****@*****.**', 2, 3) self.assertEqual(student.name, 'John Doe') self.assertEqual(student.id_and_name, '0000 John Doe') self.assertEqual(student.name_or_id, 'John Doe') self.assertEqual(student.last_comma_first_name, 'Doe, John')
def test_no_name(self): student = utils.Student(1, '0000', None, None, None, '*****@*****.**', 2, 3) self.assertEqual(student.name, '') self.assertEqual(student.id_and_name, '0000') self.assertEqual(student.name_or_id, '0000') self.assertEqual(student.last_comma_first_name, '')
def test_full_name(self): student = utils.Student(1, '0000', 'John Doe', None, None, '*****@*****.**', 2, 3) self.assertEqual(student.name, 'John Doe') self.assertEqual(student.id_and_name, '0000 John Doe') self.assertEqual(student.name_or_id, 'John Doe')