Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
4bb341c8
Commit
4bb341c8
authored
Mar 05, 2015
by
Matt Drayer
Committed by
Jonathan Piacenti
Aug 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mattdrayer/fix_broken_tests: Updated stale dates throughout test suite
parent
ac3c0438
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
56 additions
and
24 deletions
+56
-24
lms/djangoapps/api_manager/courses/tests.py
+1
-1
lms/djangoapps/api_manager/management/commands/tests/test_migrate_courseids.py
+2
-2
lms/djangoapps/api_manager/test_receivers.py
+1
-1
lms/djangoapps/api_manager/users/tests.py
+5
-5
lms/djangoapps/courseware/management/commands/tests/test_delete_course_references.py
+1
-1
lms/djangoapps/gradebook/management/commands/tests/test_generate_gradebook_entries.py
+7
-2
lms/djangoapps/gradebook/tests.py
+28
-5
lms/djangoapps/instructor/tests/test_receivers.py
+1
-1
lms/djangoapps/progress/management/commands/tests/test_generate_progress_entries.py
+1
-1
lms/djangoapps/projects/management/commands/tests/test_migrate_project_courseids.py
+2
-2
lms/djangoapps/projects/tests/test_receivers.py
+1
-1
lms/djangoapps/projects/tests/test_workgroups.py
+1
-1
lms/envs/common.py
+5
-1
No files found.
lms/djangoapps/api_manager/courses/tests.py
View file @
4bb341c8
...
...
@@ -1736,7 +1736,7 @@ class CoursesApiTests(ModuleStoreTestCase):
number
=
'4033'
,
name
=
'leaders_by_completions'
,
start
=
datetime
(
2014
,
9
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
)
end
=
datetime
(
20
20
,
1
,
16
)
)
chapter
=
ItemFactory
.
create
(
...
...
lms/djangoapps/api_manager/management/commands/tests/test_migrate_courseids.py
View file @
4bb341c8
...
...
@@ -23,7 +23,7 @@ class MigrateCourseIdsTests(ModuleStoreTestCase):
self
.
course
=
CourseFactory
.
create
(
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
)
end
=
datetime
(
20
20
,
1
,
16
)
)
self
.
test_data
=
'<html>{}</html>'
.
format
(
str
(
uuid
.
uuid4
()))
...
...
@@ -43,7 +43,7 @@ class MigrateCourseIdsTests(ModuleStoreTestCase):
self
.
course2
=
CourseFactory
.
create
(
org
=
'TEST'
,
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
)
end
=
datetime
(
20
20
,
1
,
16
)
)
self
.
chapter2
=
ItemFactory
.
create
(
category
=
"chapter"
,
...
...
lms/djangoapps/api_manager/test_receivers.py
View file @
4bb341c8
...
...
@@ -23,7 +23,7 @@ class ApiManagerReceiversTests(ModuleStoreTestCase):
# Create a course to work with
self
.
course
=
CourseFactory
.
create
(
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
)
end
=
datetime
(
20
20
,
1
,
16
)
)
test_data
=
'<html>{}</html>'
.
format
(
str
(
uuid
.
uuid4
()))
...
...
lms/djangoapps/api_manager/users/tests.py
View file @
4bb341c8
...
...
@@ -1628,7 +1628,7 @@ class UsersApiTests(ModuleStoreTestCase):
course2
=
CourseFactory
.
create
(
display_name
=
"TEST COURSE2"
,
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
,
14
,
30
),
end
=
datetime
(
20
20
,
1
,
16
,
14
,
30
),
org
=
'TURLG'
,
run
=
'TURLG1'
)
...
...
@@ -1636,7 +1636,7 @@ class UsersApiTests(ModuleStoreTestCase):
course3
=
CourseFactory
.
create
(
display_name
=
"TEST COURSE3"
,
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
,
14
,
30
),
end
=
datetime
(
20
20
,
1
,
16
,
14
,
30
),
org
=
'TURLG2'
,
run
=
'TURLG2'
)
...
...
@@ -1717,7 +1717,7 @@ class UsersApiTests(ModuleStoreTestCase):
course2
=
CourseFactory
.
create
(
display_name
=
"TEST COURSE2"
,
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
,
14
,
30
),
end
=
datetime
(
20
20
,
1
,
16
,
14
,
30
),
org
=
'TURLP2'
,
run
=
'TURLP2'
)
...
...
@@ -1728,7 +1728,7 @@ class UsersApiTests(ModuleStoreTestCase):
course3
=
CourseFactory
.
create
(
display_name
=
"TEST COURSE3"
,
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
,
14
,
30
),
end
=
datetime
(
20
20
,
1
,
16
,
14
,
30
),
org
=
'TURLP3'
,
run
=
'TURLP3'
)
...
...
@@ -1739,7 +1739,7 @@ class UsersApiTests(ModuleStoreTestCase):
course4
=
CourseFactory
.
create
(
display_name
=
"COURSE4 NO MODERATOR"
,
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
,
14
,
30
),
end
=
datetime
(
20
20
,
1
,
16
,
14
,
30
),
org
=
'TURLP4'
,
run
=
'TURLP4'
)
...
...
lms/djangoapps/courseware/management/commands/tests/test_delete_course_references.py
View file @
4bb341c8
...
...
@@ -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
(
20
15
,
1
,
16
)
end
=
datetime
(
20
20
,
1
,
16
)
)
test_data
=
'<html>{}</html>'
.
format
(
str
(
uuid
.
uuid4
()))
...
...
lms/djangoapps/gradebook/management/commands/tests/test_generate_gradebook_entries.py
View file @
4bb341c8
...
...
@@ -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
...
...
@@ -31,7 +31,8 @@ class GenerateGradebookEntriesTests(ModuleStoreTestCase):
# 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
()))
...
...
@@ -131,6 +132,10 @@ class GenerateGradebookEntriesTests(ModuleStoreTestCase):
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
...
...
lms/djangoapps/gradebook/tests.py
View file @
4bb341c8
...
...
@@ -122,6 +122,10 @@ class GradebookTests(ModuleStoreTestCase):
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
)
...
...
@@ -150,7 +154,10 @@ class GradebookTests(ModuleStoreTestCase):
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
()))
...
...
@@ -168,7 +175,10 @@ class GradebookTests(ModuleStoreTestCase):
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
()))
...
...
@@ -186,7 +196,10 @@ class GradebookTests(ModuleStoreTestCase):
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
()))
...
...
@@ -204,7 +217,10 @@ class GradebookTests(ModuleStoreTestCase):
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
...
...
@@ -226,7 +242,10 @@ class GradebookTests(ModuleStoreTestCase):
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
...
...
@@ -248,6 +267,10 @@ class GradebookTests(ModuleStoreTestCase):
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
)
...
...
lms/djangoapps/instructor/tests/test_receivers.py
View file @
4bb341c8
...
...
@@ -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
(
20
15
,
1
,
16
)
end
=
datetime
(
20
20
,
1
,
16
)
)
test_data
=
'<html>{}</html>'
.
format
(
str
(
uuid
.
uuid4
()))
...
...
lms/djangoapps/progress/management/commands/tests/test_generate_progress_entries.py
View file @
4bb341c8
...
...
@@ -28,7 +28,7 @@ class GenerateProgressEntriesTests(ModuleStoreTestCase):
# Create a couple courses to work with
self
.
course
=
CourseFactory
.
create
(
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
)
end
=
datetime
(
20
20
,
1
,
16
)
)
self
.
test_data
=
'<html>{}</html>'
.
format
(
str
(
uuid
.
uuid4
()))
...
...
lms/djangoapps/projects/management/commands/tests/test_migrate_project_courseids.py
View file @
4bb341c8
...
...
@@ -26,7 +26,7 @@ class MigrateCourseIdsTests(TestCase):
self
.
course
=
CourseFactory
.
create
(
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
)
end
=
datetime
(
20
20
,
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
(
20
15
,
1
,
16
)
end
=
datetime
(
20
20
,
1
,
16
)
)
self
.
chapter2
=
ItemFactory
.
create
(
category
=
"chapter"
,
...
...
lms/djangoapps/projects/tests/test_receivers.py
View file @
4bb341c8
...
...
@@ -23,7 +23,7 @@ class ProjectsReceiversTests(ModuleStoreTestCase):
# Create a course to work with
self
.
course
=
CourseFactory
.
create
(
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
)
end
=
datetime
(
20
20
,
1
,
16
)
)
test_data
=
'<html>{}</html>'
.
format
(
str
(
uuid
.
uuid4
()))
...
...
lms/djangoapps/projects/tests/test_workgroups.py
View file @
4bb341c8
...
...
@@ -62,7 +62,7 @@ class WorkgroupsApiTests(ModuleStoreTestCase):
self
.
test_course
=
CourseFactory
.
create
(
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
20
15
,
1
,
16
,
14
,
30
)
end
=
datetime
(
20
20
,
1
,
16
,
14
,
30
)
)
self
.
test_data
=
'<html>{}</html>'
.
format
(
str
(
uuid
.
uuid4
()))
...
...
lms/envs/common.py
View file @
4bb341c8
...
...
@@ -1950,7 +1950,7 @@ INSTALLED_APPS = (
'teams'
,
'xblock_django'
,
# EDX API application
'api_manager'
,
)
...
...
@@ -2413,6 +2413,10 @@ OPTIONAL_APPS = (
# milestones
'milestones'
,
# mckinsey apps
'gradebook'
,
)
for
app_name
in
OPTIONAL_APPS
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment