From ddf1874ca42d7d226679cc24b8698fe521da4074 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 14 May 2014 15:59:25 -0400 Subject: [PATCH] Fix merge conflicts --- lms/djangoapps/courseware/tests/test_views.py | 15 ++------------- lms/djangoapps/instructor/tests/test_api.py | 7 ------- .../instructor/tests/test_legacy_anon_csv.py | 8 -------- lms/djangoapps/instructor/views/api.py | 8 +------- lms/djangoapps/instructor/views/legacy.py | 8 +------- 5 files changed, 4 insertions(+), 42 deletions(-) diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index c32af53a5e..ff052fa540 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -451,16 +451,11 @@ class ProgressPageTests(ModuleStoreTestCase): MakoMiddleware().process_request(self.request) -<<<<<<< HEAD - course = CourseFactory(start=datetime(2013, 9, 16, 7, 17, 28)) - self.course = modulestore().get_course(course.id) # pylint: disable=no-member -======= course = CourseFactory( start=datetime(2013, 9, 16, 7, 17, 28), grade_cutoffs={u'çü†øƒƒ': 0.75, 'Pass': 0.5}, ) - self.course = modulestore().get_instance(course.id, course.location) # pylint: disable=no-member ->>>>>>> edx/master + self.course = modulestore().get_course(course.id) # pylint: disable=no-member self.chapter = ItemFactory(category='chapter', parent_location=self.course.location) # pylint: disable=no-member self.section = ItemFactory(category='sequential', parent_location=self.chapter.location) @@ -469,15 +464,9 @@ class ProgressPageTests(ModuleStoreTestCase): def test_pure_ungraded_xblock(self): ItemFactory(category='acid', parent_location=self.vertical.location) -<<<<<<< HEAD resp = views.progress(self.request, self.course.id.to_deprecated_string()) - self.assertEquals(resp.status_code, 200) -======= - resp = views.progress(self.request, self.course.id) self.assertEqual(resp.status_code, 200) def test_non_asci_grade_cutoffs(self): - resp = views.progress(self.request, self.course.id) + resp = views.progress(self.request, self.course.id.to_deprecated_string()) self.assertEqual(resp.status_code, 200) - ->>>>>>> edx/master diff --git a/lms/djangoapps/instructor/tests/test_api.py b/lms/djangoapps/instructor/tests/test_api.py index 8d34e80a8f..e052ea13ed 100644 --- a/lms/djangoapps/instructor/tests/test_api.py +++ b/lms/djangoapps/instructor/tests/test_api.py @@ -1330,15 +1330,8 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa """ Test the CSV output for the anonymized user ids. """ -<<<<<<< HEAD url = reverse('get_anon_ids', kwargs={'course_id': self.course.id.to_deprecated_string()}) - with patch('instructor.views.api.unique_id_for_user') as mock_unique: - mock_unique.return_value = '42' - response = self.client.get(url, {}) -======= - url = reverse('get_anon_ids', kwargs={'course_id': self.course.id}) response = self.client.get(url, {}) ->>>>>>> edx/master self.assertEqual(response['Content-Type'], 'text/csv') body = response.content.replace('\r', '') self.assertTrue(body.startswith( diff --git a/lms/djangoapps/instructor/tests/test_legacy_anon_csv.py b/lms/djangoapps/instructor/tests/test_legacy_anon_csv.py index c25abd1335..678b96c1df 100644 --- a/lms/djangoapps/instructor/tests/test_legacy_anon_csv.py +++ b/lms/djangoapps/instructor/tests/test_legacy_anon_csv.py @@ -56,16 +56,8 @@ class TestInstructorDashboardAnonCSV(ModuleStoreTestCase, LoginEnrollmentTestCas @patch.object(instructor.views.legacy, 'unique_id_for_user', Mock(return_value='41')) def test_download_anon_csv(self): course = self.toy -<<<<<<< HEAD url = reverse('instructor_dashboard_legacy', kwargs={'course_id': course.id.to_deprecated_string()}) - - with patch('instructor.views.legacy.unique_id_for_user') as mock_unique: - mock_unique.return_value = 42 - response = self.client.post(url, {'action': 'Download CSV of all student anonymized IDs'}) -======= - url = reverse('instructor_dashboard_legacy', kwargs={'course_id': course.id}) response = self.client.post(url, {'action': 'Download CSV of all student anonymized IDs'}) ->>>>>>> edx/master self.assertEqual(response['Content-Type'], 'text/csv') body = response.content.replace('\r', '') diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index d95372eeca..88c2d734ee 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -630,15 +630,9 @@ def get_anon_ids(request, course_id): # pylint: disable=W0613 students = User.objects.filter( courseenrollment__course_id=course_id, ).order_by('id') -<<<<<<< HEAD - header = ['User ID', 'Anonymized user ID'] - rows = [[s.id, unique_id_for_user(s)] for s in students] - return csv_response(course_id.to_deprecated_string().replace('/', '-') + '-anon-ids.csv', header, rows) -======= header = ['User ID', 'Anonymized user ID', 'Course Specific Anonymized user ID'] rows = [[s.id, unique_id_for_user(s), anonymous_id_for_user(s, course_id)] for s in students] - return csv_response(course_id.replace('/', '-') + '-anon-ids.csv', header, rows) ->>>>>>> edx/master + return csv_response(course_id.to_deprecated_string().replace('/', '-') + '-anon-ids.csv', header, rows) @ensure_csrf_cookie diff --git a/lms/djangoapps/instructor/views/legacy.py b/lms/djangoapps/instructor/views/legacy.py index 139bd8c0d2..dad6378d4b 100644 --- a/lms/djangoapps/instructor/views/legacy.py +++ b/lms/djangoapps/instructor/views/legacy.py @@ -692,15 +692,9 @@ def instructor_dashboard(request, course_id): courseenrollment__course_id=course_key, ).order_by('id') -<<<<<<< HEAD - datatable = {'header': ['User ID', 'Anonymized user ID']} - datatable['data'] = [[s.id, unique_id_for_user(s)] for s in students] - return return_csv(course_key.to_deprecated_string().replace('/', '-') + '-anon-ids.csv', datatable) -======= datatable = {'header': ['User ID', 'Anonymized user ID', 'Course Specific Anonymized user ID']} datatable['data'] = [[s.id, unique_id_for_user(s), anonymous_id_for_user(s, course_id)] for s in students] - return return_csv(course_id.replace('/', '-') + '-anon-ids.csv', datatable) ->>>>>>> edx/master + return return_csv(course_id.to_deprecated_string().replace('/', '-') + '-anon-ids.csv', datatable) #---------------------------------------- # Group management