Commit 176d6a76 by Matt Drayer

mattdrayer/fix_broken_tests: Updated stale dates throughout test suite

parent dabaaa76
......@@ -1740,7 +1740,7 @@ class CoursesApiTests(TestCase):
number='4033',
name='leaders_by_completions',
start=datetime(2014, 9, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16)
)
chapter = ItemFactory.create(
......
......@@ -27,7 +27,7 @@ class MigrateCourseIdsTests(TestCase):
self.course = CourseFactory.create(
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16)
)
self.test_data = '<html>{}</html>'.format(str(uuid.uuid4()))
......@@ -47,7 +47,7 @@ class MigrateCourseIdsTests(TestCase):
self.course2 = CourseFactory.create(
org='TEST',
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16)
)
self.chapter2 = ItemFactory.create(
category="chapter",
......
......@@ -26,7 +26,7 @@ class ApiManagerReceiversTests(TestCase):
# Create a course to work with
self.course = CourseFactory.create(
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16)
)
test_data = '<html>{}</html>'.format(str(uuid.uuid4()))
......
......@@ -1631,7 +1631,7 @@ class UsersApiTests(TestCase):
course2 = CourseFactory.create(
display_name="TEST COURSE2",
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16, 14, 30),
end=datetime(2020, 1, 16, 14, 30),
org='TURLG',
run='TURLG1'
)
......@@ -1639,7 +1639,7 @@ class UsersApiTests(TestCase):
course3 = CourseFactory.create(
display_name="TEST COURSE3",
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16, 14, 30),
end=datetime(2020, 1, 16, 14, 30),
org='TURLG2',
run='TURLG2'
)
......@@ -1720,7 +1720,7 @@ class UsersApiTests(TestCase):
course2 = CourseFactory.create(
display_name="TEST COURSE2",
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16, 14, 30),
end=datetime(2020, 1, 16, 14, 30),
org='TURLP2',
run='TURLP2'
)
......@@ -1731,7 +1731,7 @@ class UsersApiTests(TestCase):
course3 = CourseFactory.create(
display_name="TEST COURSE3",
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16, 14, 30),
end=datetime(2020, 1, 16, 14, 30),
org='TURLP3',
run='TURLP3'
)
......@@ -1742,7 +1742,7 @@ class UsersApiTests(TestCase):
course4 = CourseFactory.create(
display_name="COURSE4 NO MODERATOR",
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16, 14, 30),
end=datetime(2020, 1, 16, 14, 30),
org='TURLP4',
run='TURLP4'
)
......
......@@ -37,7 +37,7 @@ class DeleteCourseReferencesTests(TestCase):
# Create a course to work with
self.course = CourseFactory.create(
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16)
)
test_data = '<html>{}</html>'.format(str(uuid.uuid4()))
......
......@@ -3,7 +3,7 @@ Run these tests @ Devstack:
rake fasttest_lms[common/djangoapps/api_manager/management/commands/tests/test_migrate_orgdata.py]
"""
from datetime import datetime
from mock import MagicMock
from mock import MagicMock, patch
import uuid
from django.conf import settings
......@@ -34,7 +34,8 @@ class GenerateGradebookEntriesTests(TestCase):
# Create a couple courses to work with
self.course = CourseFactory.create(
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16),
org='GRADEBOOK'
)
self.test_data = '<html>{}</html>'.format(str(uuid.uuid4()))
......@@ -134,6 +135,10 @@ class GenerateGradebookEntriesTests(TestCase):
course.id
)._xmodule
@patch.dict(settings.FEATURES, {
'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False,
'SIGNAL_ON_SCORE_CHANGED': True
})
def test_generate_gradebook_entries(self):
"""
Test the gradebook entry generator
......
......@@ -124,6 +124,10 @@ class GradebookTests(TestCase):
metadata={'rerandomize': 'always', 'graded': True, 'format': "Final Exam"}
)
@patch.dict(settings.FEATURES, {
'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False,
'SIGNAL_ON_SCORE_CHANGED': True
})
def test_receiver_on_score_changed(self):
self._create_course()
module = self.get_module_for_user(self.user, self.course, self.problem)
......@@ -152,7 +156,10 @@ class GradebookTests(TestCase):
history = StudentGradebookHistory.objects.all()
self.assertEqual(len(history), 5)
@patch.dict(settings.FEATURES, {'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False})
@patch.dict(settings.FEATURES, {
'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False,
'SIGNAL_ON_SCORE_CHANGED': True
})
def test_open_course(self):
self._create_course(start=datetime(2010,1,1, tzinfo=UTC()), end=datetime(3000, 1, 1, tzinfo=UTC()))
......@@ -170,7 +177,10 @@ class GradebookTests(TestCase):
history = StudentGradebookHistory.objects.all()
self.assertEqual(len(history), 2)
@patch.dict(settings.FEATURES, {'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False})
@patch.dict(settings.FEATURES, {
'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False,
'SIGNAL_ON_SCORE_CHANGED': True
})
def test_not_yet_started_course(self):
self._create_course(start=datetime(3000,1,1, tzinfo=UTC()), end=datetime(3000, 1, 1, tzinfo=UTC()))
......@@ -188,7 +198,10 @@ class GradebookTests(TestCase):
history = StudentGradebookHistory.objects.all()
self.assertEqual(len(history), 2)
@patch.dict(settings.FEATURES, {'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False})
@patch.dict(settings.FEATURES, {
'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False,
'SIGNAL_ON_SCORE_CHANGED': True
})
def test_closed_course_student(self):
self._create_course(start=datetime(2010,1,1, tzinfo=UTC()), end=datetime(2011, 1, 1, tzinfo=UTC()))
......@@ -206,7 +219,10 @@ class GradebookTests(TestCase):
history = StudentGradebookHistory.objects.all()
self.assertEqual(len(history), 0)
@patch.dict(settings.FEATURES, {'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False})
@patch.dict(settings.FEATURES, {
'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False,
'SIGNAL_ON_SCORE_CHANGED': True
})
def test_closed_course_admin(self):
"""
Users marked as Admin should be able to submit grade events to a closed course
......@@ -228,7 +244,10 @@ class GradebookTests(TestCase):
history = StudentGradebookHistory.objects.all()
self.assertEqual(len(history), 0)
@patch.dict(settings.FEATURES, {'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False})
@patch.dict(settings.FEATURES, {
'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False,
'SIGNAL_ON_SCORE_CHANGED': True
})
def test_closed_course_staff(self):
"""
Users marked as course staff should be able to submit grade events to a closed course
......@@ -250,6 +269,10 @@ class GradebookTests(TestCase):
history = StudentGradebookHistory.objects.all()
self.assertEqual(len(history), 0)
@patch.dict(settings.FEATURES, {
'ALLOW_STUDENT_STATE_UPDATES_ON_CLOSED_COURSE': False,
'SIGNAL_ON_SCORE_CHANGED': True
})
def test_receiver_on_course_deleted(self):
self._create_course(start=datetime(2010, 1, 1, tzinfo=UTC()), end=datetime(2020, 1, 1, tzinfo=UTC()))
module = self.get_module_for_user(self.user, self.course, self.problem)
......
......@@ -26,7 +26,7 @@ class InstructorReceiversTests(TestCase):
# Create a course to work with
self.course = CourseFactory.create(
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16)
)
test_data = '<html>{}</html>'.format(str(uuid.uuid4()))
......
......@@ -31,7 +31,7 @@ class GenerateProgressEntriesTests(TestCase):
# Create a couple courses to work with
self.course = CourseFactory.create(
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16)
)
self.test_data = '<html>{}</html>'.format(str(uuid.uuid4()))
......
......@@ -26,7 +26,7 @@ class MigrateCourseIdsTests(TestCase):
self.course = CourseFactory.create(
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16)
)
self.test_data = '<html>{}</html>'.format(str(uuid.uuid4()))
......@@ -46,7 +46,7 @@ class MigrateCourseIdsTests(TestCase):
self.course2 = CourseFactory.create(
org='TEST',
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16)
)
self.chapter2 = ItemFactory.create(
category="chapter",
......
......@@ -26,7 +26,7 @@ class ProjectsReceiversTests(TestCase):
# Create a course to work with
self.course = CourseFactory.create(
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16)
end=datetime(2020, 1, 16)
)
test_data = '<html>{}</html>'.format(str(uuid.uuid4()))
......
......@@ -62,7 +62,7 @@ class WorkgroupsApiTests(TestCase):
self.test_course = CourseFactory.create(
start=datetime(2014, 6, 16, 14, 30),
end=datetime(2015, 1, 16, 14, 30)
end=datetime(2020, 1, 16, 14, 30)
)
self.test_data = '<html>{}</html>'.format(str(uuid.uuid4()))
......
......@@ -1419,7 +1419,7 @@ INSTALLED_APPS = (
# Country list
'django_countries',
# EDX API application
'api_manager',
)
......@@ -1756,7 +1756,10 @@ OPTIONAL_APPS = (
'openassessment.assessment',
'openassessment.fileupload',
'openassessment.workflow',
'openassessment.xblock'
'openassessment.xblock',
# mckinsey apps
'gradebook',
)
for app_name in OPTIONAL_APPS:
......
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