'Check the output of the report.
Arguments:
output (list): List of rows in the output CSV file.
*args: Tuples of (user, course_id, opt_in_pref)
Keyword Arguments:
expect_pref_datetime (bool): If false, expect the default datetime.
Returns:
None
Raises:
AssertionError'

def _assert_output(self, output, *args, **kwargs):

    self.assertEqual(len(output), (len(args) + 1))
    self.assertEqual({'user_id': 'user_id', 'username': 'username', 'email': 'email', 'full_name': 'full_name', 'course_id': 'course_id', 'is_opted_in_for_email': 'is_opted_in_for_email', 'preference_set_datetime': 'preference_set_datetime'}, output[0])
    for (user, course_id, opt_in_pref) in args:
        self.assertIn({'user_id': str(user.id), 'username': user.username.encode('utf-8'), 'email': user.email.encode('utf-8'), 'full_name': (user.profile.name.encode('utf-8') if hasattr(user, 'profile') else ''), 'course_id': unicode(course_id).encode('utf-8'), 'is_opted_in_for_email': unicode(opt_in_pref), 'preference_set_datetime': (self._latest_pref_set_datetime(self.user) if kwargs.get('expect_pref_datetime', True) else self.DEFAULT_DATETIME_STR)}, output[1:])
