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
d056c8a8
Commit
d056c8a8
authored
Jul 08, 2013
by
Adam Palay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace test setting changes with test-specific mock.patch.dicts
parent
3b662ee0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
cms/djangoapps/contentstore/tests/test_request_event.py
+4
-0
cms/envs/test.py
+0
-3
common/djangoapps/track/tests.py
+4
-0
lms/envs/test.py
+0
-3
No files found.
cms/djangoapps/contentstore/tests/test_request_event.py
View file @
d056c8a8
"""Tests for CMS's requests to logs"""
import
mock
from
django.test
import
TestCase
from
django.core.urlresolvers
import
reverse
from
contentstore.views.requests
import
event
as
cms_user_track
...
...
@@ -18,6 +20,7 @@ class CMSLogTest(TestCase):
{
"event"
:
"my_event"
,
"event_type"
:
"my_event_type"
,
"page"
:
"my_page"
},
{
"event"
:
"{'json': 'object'}"
,
"event_type"
:
unichr
(
512
),
"page"
:
"my_page"
}
]
with
mock
.
patch
.
dict
(
'django.conf.settings.MITX_FEATURES'
,
{
'ENABLE_SQL_TRACKING_LOGS'
:
True
}):
for
request_params
in
requests
:
response
=
self
.
client
.
post
(
reverse
(
cms_user_track
),
request_params
)
self
.
assertEqual
(
response
.
status_code
,
204
)
...
...
@@ -31,6 +34,7 @@ class CMSLogTest(TestCase):
{
"event"
:
"my_event"
,
"event_type"
:
"my_event_type"
,
"page"
:
"my_page"
},
{
"event"
:
"{'json': 'object'}"
,
"event_type"
:
unichr
(
512
),
"page"
:
"my_page"
}
]
with
mock
.
patch
.
dict
(
'django.conf.settings.MITX_FEATURES'
,
{
'ENABLE_SQL_TRACKING_LOGS'
:
True
}):
for
request_params
in
requests
:
response
=
self
.
client
.
get
(
reverse
(
cms_user_track
),
request_params
)
self
.
assertEqual
(
response
.
status_code
,
204
)
cms/envs/test.py
View file @
d056c8a8
...
...
@@ -141,8 +141,5 @@ MITX_FEATURES['STUDIO_NPS_SURVEY'] = False
MITX_FEATURES
[
'ENABLE_SERVICE_STATUS'
]
=
True
# Enabling SQL tracking logs for testing on common/djangoapps/track
MITX_FEATURES
[
'ENABLE_SQL_TRACKING_LOGS'
]
=
True
# This is to disable a test under the common directory that will not pass when run under CMS
MITX_FEATURES
[
'DISABLE_PASSWORD_RESET_EMAIL_TEST'
]
=
True
common/djangoapps/track/tests.py
View file @
d056c8a8
"""Tests for student tracking"""
import
mock
from
django.test
import
TestCase
from
django.core.urlresolvers
import
reverse
,
NoReverseMatch
from
track.models
import
TrackingLog
...
...
@@ -20,6 +22,7 @@ class TrackingTest(TestCase):
{
"event"
:
"my_event"
,
"event_type"
:
"my_event_type"
,
"page"
:
"my_page"
},
{
"event"
:
"{'json': 'object'}"
,
"event_type"
:
unichr
(
512
),
"page"
:
"my_page"
}
]
with
mock
.
patch
.
dict
(
'django.conf.settings.MITX_FEATURES'
,
{
'ENABLE_SQL_TRACKING_LOGS'
:
True
}):
for
request_params
in
requests
:
try
:
# because /event maps to two different views in lms and cms, we're only going to test lms here
response
=
self
.
client
.
post
(
reverse
(
user_track
),
request_params
)
...
...
@@ -42,6 +45,7 @@ class TrackingTest(TestCase):
{
"event"
:
"my_event"
,
"event_type"
:
"my_event_type"
,
"page"
:
"my_page"
},
{
"event"
:
"{'json': 'object'}"
,
"event_type"
:
unichr
(
512
),
"page"
:
"my_page"
}
]
with
mock
.
patch
.
dict
(
'django.conf.settings.MITX_FEATURES'
,
{
'ENABLE_SQL_TRACKING_LOGS'
:
True
}):
for
request_params
in
requests
:
try
:
# because /event maps to two different views in lms and cms, we're only going to test lms here
response
=
self
.
client
.
get
(
reverse
(
user_track
),
request_params
)
...
...
lms/envs/test.py
View file @
d056c8a8
...
...
@@ -29,9 +29,6 @@ MITX_FEATURES['ENABLE_SERVICE_STATUS'] = True
MITX_FEATURES
[
'ENABLE_HINTER_INSTRUCTOR_VIEW'
]
=
True
# Enabling SQL tracking logs for testing on common/djangoapps/track
MITX_FEATURES
[
'ENABLE_SQL_TRACKING_LOGS'
]
=
True
# Need wiki for courseware views to work. TODO (vshnayder): shouldn't need it.
WIKI_ENABLED
=
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