diff options
-rw-r--r-- | yaksh/test_views.py | 17 | ||||
-rw-r--r-- | yaksh/views.py | 5 |
2 files changed, 10 insertions, 12 deletions
diff --git a/yaksh/test_views.py b/yaksh/test_views.py index fc736d3..d98435d 100644 --- a/yaksh/test_views.py +++ b/yaksh/test_views.py @@ -2582,7 +2582,6 @@ class TestCourseDetail(TestCase): self.assertIn(uploaded_user.first(), self.user1_course.students.all()) self.assertTemplateUsed(response, 'yaksh/course_detail.html') - def test_upload_existing_user(self): # Given self.client.login( @@ -2593,8 +2592,9 @@ class TestCourseDetail(TestCase): csv_file.close() # When - response = self.client.post(reverse('yaksh:upload_users', - kwargs={'course_id': self.user1_course.id}), + response = self.client.post( + reverse('yaksh:upload_users', + kwargs={'course_id': self.user1_course.id}), data={'csv_file': upload_file}) # Then @@ -2603,7 +2603,6 @@ class TestCourseDetail(TestCase): self.assertTemplateUsed(response, 'yaksh/course_detail.html') self.assertIn(self.user2, self.user1_course.students.all()) - def test_upload_same_user_multiple_course(self): # Given self.client.login( @@ -2617,14 +2616,14 @@ class TestCourseDetail(TestCase): # When response1 = self.client.post( - reverse('yaksh:upload_users', + reverse('yaksh:upload_users', kwargs={'course_id': self.user1_course.id}), - data={'csv_file': upload_file1}) + data={'csv_file': upload_file1}) response2 = self.client.post( - reverse('yaksh:upload_users', + reverse('yaksh:upload_users', kwargs={'course_id': self.user1_othercourse.id}), - data={'csv_file': upload_file2}) + data={'csv_file': upload_file2}) # Then uploaded_users = User.objects.filter(email='abc@xyz.com') @@ -2638,7 +2637,6 @@ class TestCourseDetail(TestCase): self.assertIn(uploaded_users.first(), self.user1_othercourse.students.all()) - def test_upload_users_add_update_reject(self): # Given self.client.login( @@ -2667,7 +2665,6 @@ class TestCourseDetail(TestCase): self.assertIn('upload_details', response.context) self.assertTemplateUsed(response, 'yaksh/course_detail.html') - def test_upload_users_with_wrong_csv(self): # Given self.client.login( diff --git a/yaksh/views.py b/yaksh/views.py index 5d9d5db..ef18148 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -2221,8 +2221,9 @@ def _read_user_csv(reader, course): counter, user.username)) else: _add_to_course(user, course) - upload_details.append("{0} -- {1} -- User Added Successfully".format( - counter, user.username)) + upload_details.append( + "{0} -- {1} -- User Added Successfully".format( + counter, user.username)) continue user_defaults = {'email': email, 'first_name': first_name, 'last_name': last_name} |