def test_enrollment_lname_last(self):
     """
     Test the case where sortable_name contains a single string (just first or last)
     """
     res = manage_sections_tags.enrollment_lname(
         {'user': {
             'sortable_name': 'Prince'
         }})
     self.assertEqual(res, 'Prince',
                      'Result should match sortable_name single string')
 def test_enrollment_lname_last_comma_first(self):
     """
     Test the normal case where sortable_name is comma separated
     """
     res = manage_sections_tags.enrollment_lname(
         {'user': {
             'sortable_name': 'Last, First'
         }})
     self.assertEqual(
         res, 'Last', 'Result should match last name part of sortable_name')
 def test_enrollment_lname_no_user(self):
     """
     Test the case where the parameter doesn't even have a user key
     """
     res = manage_sections_tags.enrollment_lname({})
     self.assertEqual(res, '', 'Result should be an empty string')
 def test_enrollment_lname_no_sortable_name(self):
     """
     Test the case where sortable_name is missing from user dict fields
     """
     res = manage_sections_tags.enrollment_lname({'user': {}})
     self.assertEqual(res, '', 'Result should be an empty string')
 def test_enrollment_lname_last(self):
     """
     Test the case where sortable_name contains a single string (just first or last)
     """
     res = manage_sections_tags.enrollment_lname({'user': {'sortable_name': 'Prince'}})
     self.assertEqual(res, 'Prince', 'Result should match sortable_name single string')
 def test_enrollment_lname_last_comma_first(self):
     """
     Test the normal case where sortable_name is comma separated
     """
     res = manage_sections_tags.enrollment_lname({'user': {'sortable_name': 'Last, First'}})
     self.assertEqual(res, 'Last', 'Result should match last name part of sortable_name')
 def test_enrollment_lname_no_sortable_name(self):
     """
     Test the case where sortable_name is missing from user dict fields
     """
     res = manage_sections_tags.enrollment_lname({'user': {}})
     self.assertEqual(res, '', 'Result should be an empty string')
 def test_enrollment_lname_no_user(self):
     """
     Test the case where the parameter doesn't even have a user key
     """
     res = manage_sections_tags.enrollment_lname({})
     self.assertEqual(res, '', 'Result should be an empty string')