From e47f8b1765ae74c1ca98a1fa3b1ab783aeaeae79 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Wed, 29 May 2013 12:39:18 -0400 Subject: [PATCH] Coding consistency changes for code review. --- cms/djangoapps/contentstore/tests/test_contentstore.py | 2 +- common/lib/xmodule/xmodule/course_module.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 1e6ab8cd86..03449fc22f 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -990,7 +990,7 @@ class ContentStoreTest(ModuleStoreTestCase): def test_metadata_inheritance(self): module_store = modulestore('direct') - import_from_xml(module_store, 'common/test/data/', ['full'], verbose=True) + import_from_xml(module_store, 'common/test/data/', ['full']) course = module_store.get_item(Location(['i4x', 'edX', 'full', 'course', '6.002_Spring_2012', None])) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 66d53b43ec..065c179084 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -18,6 +18,7 @@ import json from xblock.core import Scope, List, String, Object, Boolean from .fields import Date from django.utils.timezone import UTC +from xmodule.util import date_utils log = logging.getLogger(__name__) @@ -743,15 +744,15 @@ class CourseDescriptor(CourseFields, SequenceDescriptor): @property def first_eligible_appointment_date_text(self): - return datetime.strftime("%b %d, %Y", self.first_eligible_appointment_date) + return self.first_eligible_appointment_date.strftime("%b %d, %Y") @property def last_eligible_appointment_date_text(self): - return datetime.strftime("%b %d, %Y", self.last_eligible_appointment_date) + return self.last_eligible_appointment_date.strftime("%b %d, %Y") @property def registration_end_date_text(self): - return datetime.strftime("%b %d, %Y at %H:%M UTC", self.registration_end_date) + return date_utils.get_default_time_display(self.registration_end_date) @property def current_test_center_exam(self):