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
28f8910d
Commit
28f8910d
authored
May 31, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make pymongo tz_aware
parent
85543334
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
11 deletions
+16
-11
cms/djangoapps/contentstore/tests/test_course_settings.py
+3
-6
cms/envs/acceptance.py
+1
-0
cms/envs/dev.py
+2
-1
cms/envs/test.py
+2
-1
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
+3
-2
lms/djangoapps/courseware/tests/tests.py
+2
-1
lms/envs/acceptance.py
+1
-0
lms/envs/cms/dev.py
+1
-0
lms/envs/dev_mongo.py
+1
-0
No files found.
cms/djangoapps/contentstore/tests/test_course_settings.py
View file @
28f8910d
...
...
@@ -54,6 +54,7 @@ class CourseDetailsTestCase(CourseTestCase):
def
test_virgin_fetch
(
self
):
details
=
CourseDetails
.
fetch
(
self
.
course_location
)
self
.
assertEqual
(
details
.
course_location
,
self
.
course_location
,
"Location not copied into"
)
self
.
assertIsNotNone
(
details
.
start_date
.
tzinfo
)
self
.
assertIsNone
(
details
.
end_date
,
"end date somehow initialized "
+
str
(
details
.
end_date
))
self
.
assertIsNone
(
details
.
enrollment_start
,
"enrollment_start date somehow initialized "
+
str
(
details
.
enrollment_start
))
self
.
assertIsNone
(
details
.
enrollment_end
,
"enrollment_end date somehow initialized "
+
str
(
details
.
enrollment_end
))
...
...
@@ -67,7 +68,6 @@ class CourseDetailsTestCase(CourseTestCase):
jsondetails
=
json
.
dumps
(
details
,
cls
=
CourseSettingsEncoder
)
jsondetails
=
json
.
loads
(
jsondetails
)
self
.
assertTupleEqual
(
Location
(
jsondetails
[
'course_location'
]),
self
.
course_location
,
"Location !="
)
# Note, start_date is being initialized someplace. I'm not sure why b/c the default will make no sense.
self
.
assertIsNone
(
jsondetails
[
'end_date'
],
"end date somehow initialized "
)
self
.
assertIsNone
(
jsondetails
[
'enrollment_start'
],
"enrollment_start date somehow initialized "
)
self
.
assertIsNone
(
jsondetails
[
'enrollment_end'
],
"enrollment_end date somehow initialized "
)
...
...
@@ -116,11 +116,8 @@ class CourseDetailsViewTest(CourseTestCase):
self
.
compare_details_with_encoding
(
json
.
loads
(
resp
.
content
),
details
.
__dict__
,
field
+
str
(
val
))
@staticmethod
def
convert_datetime_to_iso
(
datetime
):
if
datetime
is
not
None
:
return
datetime
.
isoformat
(
"T"
)
else
:
return
None
def
convert_datetime_to_iso
(
dt
):
return
Date
()
.
to_json
(
dt
)
def
test_update_and_fetch
(
self
):
details
=
CourseDetails
.
fetch
(
self
.
course_location
)
...
...
cms/envs/acceptance.py
View file @
28f8910d
...
...
@@ -24,6 +24,7 @@ MODULESTORE_OPTIONS = {
'collection'
:
'acceptance_modulestore'
,
'fs_root'
:
TEST_ROOT
/
"data"
,
'render_template'
:
'mitxmako.shortcuts.render_to_string'
,
'tz_aware'
:
True
}
MODULESTORE
=
{
...
...
cms/envs/dev.py
View file @
28f8910d
...
...
@@ -23,6 +23,7 @@ modulestore_options = {
'collection'
:
'modulestore'
,
'fs_root'
:
GITHUB_REPO_ROOT
,
'render_template'
:
'mitxmako.shortcuts.render_to_string'
,
'tz_aware'
:
True
}
MODULESTORE
=
{
...
...
@@ -64,7 +65,7 @@ REPOS = {
},
'content-mit-6002x'
:
{
'branch'
:
'master'
,
#'origin': 'git@github.com:MITx/6002x-fall-2012.git',
#
'origin': 'git@github.com:MITx/6002x-fall-2012.git',
'origin'
:
'git@github.com:MITx/content-mit-6002x.git'
,
},
'6.00x'
:
{
...
...
cms/envs/test.py
View file @
28f8910d
...
...
@@ -49,6 +49,7 @@ MODULESTORE_OPTIONS = {
'collection'
:
'test_modulestore'
,
'fs_root'
:
TEST_ROOT
/
"data"
,
'render_template'
:
'mitxmako.shortcuts.render_to_string'
,
'tz_aware'
:
True
}
MODULESTORE
=
{
...
...
@@ -121,7 +122,7 @@ CELERY_RESULT_BACKEND = 'cache'
BROKER_TRANSPORT
=
'memory'
################### Make tests faster
#http://slacy.com/blog/2012/04/make-your-tests-faster-in-django-1-4/
#
http://slacy.com/blog/2012/04/make-your-tests-faster-in-django-1-4/
PASSWORD_HASHERS
=
(
'django.contrib.auth.hashers.SHA1PasswordHasher'
,
'django.contrib.auth.hashers.MD5PasswordHasher'
,
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
View file @
28f8910d
...
...
@@ -19,7 +19,7 @@ DB = 'test'
COLLECTION
=
'modulestore'
FS_ROOT
=
DATA_DIR
# TODO (vshnayder): will need a real fs_root for testing load_item
DEFAULT_CLASS
=
'xmodule.raw_module.RawDescriptor'
RENDER_TEMPLATE
=
lambda
t_n
,
d
,
ctx
=
None
,
nsp
=
'main'
:
''
RENDER_TEMPLATE
=
lambda
t_n
,
d
,
ctx
=
None
,
nsp
=
'main'
:
''
class
TestMongoModuleStore
(
object
):
...
...
@@ -42,7 +42,8 @@ class TestMongoModuleStore(object):
@staticmethod
def
initdb
():
# connect to the db
store
=
MongoModuleStore
(
HOST
,
DB
,
COLLECTION
,
FS_ROOT
,
RENDER_TEMPLATE
,
default_class
=
DEFAULT_CLASS
)
store
=
MongoModuleStore
(
HOST
,
DB
,
COLLECTION
,
FS_ROOT
,
RENDER_TEMPLATE
,
default_class
=
DEFAULT_CLASS
,
tz_aware
=
True
)
# Explicitly list the courses to load (don't want the big one)
courses
=
[
'toy'
,
'simple'
]
import_from_xml
(
store
,
DATA_DIR
,
courses
)
...
...
lms/djangoapps/courseware/tests/tests.py
View file @
28f8910d
...
...
@@ -66,6 +66,7 @@ def mongo_store_config(data_dir):
'collection'
:
'modulestore_
%
s'
%
uuid4
()
.
hex
,
'fs_root'
:
data_dir
,
'render_template'
:
'mitxmako.shortcuts.render_to_string'
,
'tz_aware'
:
True
}
}
}
...
...
@@ -288,7 +289,7 @@ class PageLoaderTestCase(LoginEnrollmentTestCase):
'''
Choose a page in the course randomly, and assert that it loads
'''
# enroll in the course before trying to access pages
# enroll in the course before trying to access pages
courses
=
module_store
.
get_courses
()
self
.
assertEqual
(
len
(
courses
),
1
)
course
=
courses
[
0
]
...
...
lms/envs/acceptance.py
View file @
28f8910d
...
...
@@ -25,6 +25,7 @@ modulestore_options = {
'collection'
:
'acceptance_modulestore'
,
'fs_root'
:
TEST_ROOT
/
"data"
,
'render_template'
:
'mitxmako.shortcuts.render_to_string'
,
'tz_aware'
:
True
}
MODULESTORE
=
{
...
...
lms/envs/cms/dev.py
View file @
28f8910d
...
...
@@ -22,6 +22,7 @@ modulestore_options = {
'collection'
:
'modulestore'
,
'fs_root'
:
DATA_DIR
,
'render_template'
:
'mitxmako.shortcuts.render_to_string'
,
'tz_aware'
:
True
}
MODULESTORE
=
{
...
...
lms/envs/dev_mongo.py
View file @
28f8910d
...
...
@@ -20,6 +20,7 @@ MODULESTORE = {
'collection'
:
'modulestore'
,
'fs_root'
:
GITHUB_REPO_ROOT
,
'render_template'
:
'mitxmako.shortcuts.render_to_string'
,
'tz_aware'
:
True
}
}
}
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