remove try/catch block and associated test for EDUCATOR-1134 following verification that no stage or production courses have issues related to dates
This commit is contained in:
@@ -1453,13 +1453,4 @@ class CourseSummary(object):
|
||||
"""
|
||||
Returns whether the course has ended.
|
||||
"""
|
||||
try:
|
||||
return course_metadata_utils.has_course_ended(self.end)
|
||||
except TypeError as e:
|
||||
log.warning(
|
||||
"Course '{course_id}' has an improperly formatted end date '{end_date}'. Error: '{err}'.".format(
|
||||
course_id=unicode(self.id), end_date=self.end, err=e
|
||||
)
|
||||
)
|
||||
modified_end = self.end.replace(tzinfo=utc)
|
||||
return course_metadata_utils.has_course_ended(modified_end)
|
||||
return course_metadata_utils.has_course_ended(self.end)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import ddt
|
||||
import unittest
|
||||
from datetime import datetime, timedelta
|
||||
from dateutil import parser
|
||||
|
||||
import itertools
|
||||
from fs.memoryfs import MemoryFS
|
||||
@@ -143,16 +142,6 @@ class HasEndedMayCertifyTestCase(unittest.TestCase):
|
||||
self.assertFalse(self.future_noshow_certs.may_certify())
|
||||
|
||||
|
||||
class CourseSummaryHasEnded(unittest.TestCase):
|
||||
""" Test for has_ended method when end date is missing timezone information. """
|
||||
|
||||
def test_course_end(self):
|
||||
test_course = get_dummy_course("2012-01-01T12:00")
|
||||
bad_end_date = parser.parse("2012-02-21 10:28:45")
|
||||
summary = xmodule.course_module.CourseSummary(test_course.id, end=bad_end_date)
|
||||
self.assertTrue(summary.has_ended())
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class IsNewCourseTestCase(unittest.TestCase):
|
||||
"""Make sure the property is_new works on courses"""
|
||||
|
||||
Reference in New Issue
Block a user