Commit cde20758 by Brian Wilson

cosmetic cleanup

parent dfb99131
...@@ -12,9 +12,6 @@ ...@@ -12,9 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import logging
log = logging.getLogger("mitx." + __name__)
from django.conf import settings from django.conf import settings
from mako.template import Template as MakoTemplate from mako.template import Template as MakoTemplate
......
...@@ -290,11 +290,11 @@ class PageLoader(ActivateLoginTestCase): ...@@ -290,11 +290,11 @@ class PageLoader(ActivateLoginTestCase):
for descriptor in module_store.modules[course_id].itervalues(): for descriptor in module_store.modules[course_id].itervalues():
n += 1 n += 1
print "Checking ", descriptor.location.url() print "Checking ", descriptor.location.url()
log.info('Checking the content returned for page %s', descriptor.location.url())
#print descriptor.__class__, descriptor.location #print descriptor.__class__, descriptor.location
resp = self.client.get(reverse('jump_to', resp = self.client.get(reverse('jump_to',
kwargs={'course_id': course_id, kwargs={'course_id': course_id,
'location': descriptor.location.url()}), follow=True) 'location': descriptor.location.url()}), follow=True)
# check status codes first
msg = str(resp.status_code) msg = str(resp.status_code)
if resp.status_code != 200: if resp.status_code != 200:
msg = "ERROR " + msg + ": " + descriptor.location.url() msg = "ERROR " + msg + ": " + descriptor.location.url()
...@@ -304,6 +304,8 @@ class PageLoader(ActivateLoginTestCase): ...@@ -304,6 +304,8 @@ class PageLoader(ActivateLoginTestCase):
msg = "ERROR on redirect from " + descriptor.location.url() msg = "ERROR on redirect from " + descriptor.location.url()
all_ok = False all_ok = False
num_bad += 1 num_bad += 1
# check content to make sure there were no rendering failures
content = resp.content content = resp.content
if content.find("this module is temporarily unavailable")>=0: if content.find("this module is temporarily unavailable")>=0:
msg = "ERROR unavailable module " msg = "ERROR unavailable module "
...@@ -314,8 +316,6 @@ class PageLoader(ActivateLoginTestCase): ...@@ -314,8 +316,6 @@ class PageLoader(ActivateLoginTestCase):
msg = msg + descriptor.definition['data']['error_msg'] msg = msg + descriptor.definition['data']['error_msg']
all_ok = False all_ok = False
num_bad += 1 num_bad += 1
log.info('Output the content returned for page %s', descriptor.location.url())
log.info('Content returned: %s', content)
print msg print msg
self.assertTrue(all_ok) # fail fast self.assertTrue(all_ok) # fail fast
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment