def METHOD_NAME(self):
    empty_partition = UserPartition(
        self.TEST_ID,
        'Test Partition',
        'for testing purposes',
        [],
        scheme=RandomUserPartitionScheme
    )
    # get a group assigned to the user
    with self.assertRaisesRegex(UserPartitionError, "Cannot assign user to an empty user partition"):
        RandomUserPartitionScheme.get_group_for_user(self.MOCK_COURSE_ID, self.user, empty_partition)