From bc8c0b6db29c1654cfbe2ecea09ea8b8a32d7cc0 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Thu, 21 Mar 2013 11:09:55 -0400 Subject: [PATCH 1/2] Added unit test for what broke the system, but won't catch such a regression in future b/c the problem was persisting under one parser and reading under another. --- .../contentstore/tests/test_course_updates.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_course_updates.py b/cms/djangoapps/contentstore/tests/test_course_updates.py index 38608ee94d..73945ac194 100644 --- a/cms/djangoapps/contentstore/tests/test_course_updates.py +++ b/cms/djangoapps/contentstore/tests/test_course_updates.py @@ -90,14 +90,22 @@ class CourseUpdateTest(CourseTestCase): 'course': self.course_location.course, 'provided_id': ''}) - resp = self.client.post(url, json.dumps(payload), "application/json") - - payload = json.loads(resp.content) - self.assertContains( self.client.post(url, json.dumps(payload), "application/json"), ' Date: Thu, 21 Mar 2013 12:30:33 -0400 Subject: [PATCH 2/2] Pylint muting via docstrings and line wraps --- .../contentstore/tests/test_course_updates.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_course_updates.py b/cms/djangoapps/contentstore/tests/test_course_updates.py index 73945ac194..80d4f0bbc2 100644 --- a/cms/djangoapps/contentstore/tests/test_course_updates.py +++ b/cms/djangoapps/contentstore/tests/test_course_updates.py @@ -1,12 +1,13 @@ +'''unit tests for course_info views and models.''' from contentstore.tests.test_course_settings import CourseTestCase from django.core.urlresolvers import reverse import json -from webob.exc import HTTPServerError -from django.http import HttpResponseBadRequest class CourseUpdateTest(CourseTestCase): + '''The do all and end all of unit test cases.''' def test_course_update(self): + '''Go through each interface and ensure it works.''' # first get the update to force the creation url = reverse('course_info', kwargs={'org': self.course_location.org, @@ -18,9 +19,10 @@ class CourseUpdateTest(CourseTestCase): content = init_content + '' payload = {'content': content, 'date': 'January 8, 2013'} - url = reverse('course_info_json', kwargs={'org': self.course_location.org, - 'course': self.course_location.course, - 'provided_id': ''}) + url = reverse('course_info_json', + kwargs={'org': self.course_location.org, + 'course': self.course_location.course, + 'provided_id': ''}) resp = self.client.post(url, json.dumps(payload), "application/json")