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
ddb1ae66
Commit
ddb1ae66
authored
Apr 29, 2015
by
Christine Lytwynec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split lms unittests into multiple shards
parent
411df0ae
Hide whitespace changes
Inline
Side-by-side
Showing
79 changed files
with
313 additions
and
9 deletions
+313
-9
lms/djangoapps/branding/tests/test_models.py
+3
-0
lms/djangoapps/branding/tests/test_page.py
+4
-0
lms/djangoapps/bulk_email/tests/test_course_optout.py
+2
-0
lms/djangoapps/bulk_email/tests/test_email.py
+3
-0
lms/djangoapps/bulk_email/tests/test_err_handling.py
+2
-0
lms/djangoapps/bulk_email/tests/test_forms.py
+2
-0
lms/djangoapps/bulk_email/tests/test_models.py
+5
-0
lms/djangoapps/bulk_email/tests/test_tasks.py
+2
-0
lms/djangoapps/ccx/tests/test_models.py
+3
-0
lms/djangoapps/ccx/tests/test_overrides.py
+2
-0
lms/djangoapps/ccx/tests/test_utils.py
+7
-0
lms/djangoapps/ccx/tests/test_views.py
+4
-0
lms/djangoapps/certificates/tests/test_api.py
+5
-0
lms/djangoapps/certificates/tests/test_create_fake_cert.py
+2
-0
lms/djangoapps/certificates/tests/test_models.py
+3
-0
lms/djangoapps/certificates/tests/test_queue.py
+3
-0
lms/djangoapps/certificates/tests/test_resubmit_error_certificates.py
+2
-0
lms/djangoapps/certificates/tests/test_views.py
+3
-0
lms/djangoapps/certificates/tests/tests.py
+2
-0
lms/djangoapps/class_dashboard/tests/test_dashboard_data.py
+2
-0
lms/djangoapps/class_dashboard/tests/test_views.py
+2
-0
lms/djangoapps/commerce/tests/test_views.py
+4
-0
lms/djangoapps/course_wiki/tests/test_access.py
+5
-0
lms/djangoapps/course_wiki/tests/test_middleware.py
+2
-0
lms/djangoapps/course_wiki/tests/tests.py
+2
-0
lms/djangoapps/courseware/management/commands/tests/test_clean_history.py
+4
-0
lms/djangoapps/courseware/management/commands/tests/test_dump_course.py
+2
-0
lms/djangoapps/courseware/tests/test_about.py
+8
-0
lms/djangoapps/courseware/tests/test_access.py
+3
-0
lms/djangoapps/courseware/tests/test_course_info.py
+3
-0
lms/djangoapps/courseware/tests/test_course_survey.py
+2
-0
lms/djangoapps/courseware/tests/test_courses.py
+8
-0
lms/djangoapps/courseware/tests/test_draft_modulestore.py
+2
-0
lms/djangoapps/courseware/tests/test_entrance_exam.py
+2
-0
lms/djangoapps/courseware/tests/test_favicon.py
+2
-0
lms/djangoapps/courseware/tests/test_field_overrides.py
+3
-0
lms/djangoapps/courseware/tests/test_footer.py
+2
-0
lms/djangoapps/courseware/tests/test_grades.py
+2
-0
lms/djangoapps/courseware/tests/test_group_access.py
+2
-0
lms/djangoapps/courseware/tests/test_i18n.py
+2
-0
lms/djangoapps/courseware/tests/test_lti_integration.py
+3
-0
lms/djangoapps/courseware/tests/test_masquerade.py
+4
-0
lms/djangoapps/courseware/tests/test_microsites.py
+2
-0
lms/djangoapps/courseware/tests/test_middleware.py
+2
-0
lms/djangoapps/courseware/tests/test_model_data.py
+6
-0
lms/djangoapps/courseware/tests/test_module_render.py
+17
-0
lms/djangoapps/courseware/tests/test_navigation.py
+2
-0
lms/djangoapps/courseware/tests/test_password_history.py
+2
-0
lms/djangoapps/courseware/tests/test_recommender.py
+6
-0
lms/djangoapps/courseware/tests/test_split_module.py
+3
-0
lms/djangoapps/courseware/tests/test_submitting_problems.py
+6
-0
lms/djangoapps/courseware/tests/test_tabs.py
+5
-0
lms/djangoapps/courseware/tests/test_video_handlers.py
+8
-0
lms/djangoapps/courseware/tests/test_video_mongo.py
+6
-0
lms/djangoapps/courseware/tests/test_video_xml.py
+2
-0
lms/djangoapps/courseware/tests/test_view_authentication.py
+3
-0
lms/djangoapps/courseware/tests/test_views.py
+10
-0
lms/djangoapps/courseware/tests/test_word_cloud.py
+2
-0
lms/djangoapps/courseware/tests/tests.py
+6
-0
lms/djangoapps/dashboard/tests/test_support.py
+2
-0
lms/djangoapps/dashboard/tests/test_sysadmin.py
+3
-0
lms/djangoapps/django_comment_client/tests/test_middleware.py
+2
-0
lms/djangoapps/django_comment_client/tests/test_models.py
+3
-0
lms/djangoapps/django_comment_client/tests/test_utils.py
+7
-0
lms/djangoapps/instructor/tests/test_access.py
+5
-0
lms/djangoapps/instructor/tests/test_api.py
+18
-0
lms/djangoapps/instructor/tests/test_api_email_localization.py
+2
-0
lms/djangoapps/instructor/tests/test_certificates.py
+3
-0
lms/djangoapps/instructor/tests/test_ecommerce.py
+2
-0
lms/djangoapps/instructor/tests/test_email.py
+3
-0
lms/djangoapps/instructor/tests/test_enrollment.py
+8
-0
lms/djangoapps/instructor/tests/test_hint_manager.py
+2
-0
lms/djangoapps/instructor/tests/test_legacy_enrollment.py
+2
-0
lms/djangoapps/instructor/tests/test_legacy_raw_download_csv.py
+2
-0
lms/djangoapps/instructor/tests/test_legacy_xss.py
+2
-0
lms/djangoapps/instructor/tests/test_spoc_gradebook.py
+4
-0
lms/djangoapps/instructor/tests/test_tools.py
+10
-0
scripts/all-tests.sh
+12
-9
scripts/jenkins-report.sh
+3
-0
No files found.
lms/djangoapps/branding/tests/test_models.py
View file @
ddb1ae66
...
@@ -3,9 +3,12 @@ Tests for the Video Branding configuration.
...
@@ -3,9 +3,12 @@ Tests for the Video Branding configuration.
"""
"""
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.core.exceptions
import
ValidationError
from
django.core.exceptions
import
ValidationError
from
nose.plugins.attrib
import
attr
from
branding.models
import
BrandingInfoConfig
from
branding.models
import
BrandingInfoConfig
@attr
(
'shard_1'
)
class
BrandingInfoConfigTest
(
TestCase
):
class
BrandingInfoConfigTest
(
TestCase
):
"""
"""
Test the BrandingInfoConfig model.
Test the BrandingInfoConfig model.
...
...
lms/djangoapps/branding/tests/test_page.py
View file @
ddb1ae66
...
@@ -12,6 +12,7 @@ from django.test.client import RequestFactory
...
@@ -12,6 +12,7 @@ from django.test.client import RequestFactory
from
pytz
import
UTC
from
pytz
import
UTC
from
mock
import
patch
,
Mock
from
mock
import
patch
,
Mock
from
nose.plugins.attrib
import
attr
from
edxmako.shortcuts
import
render_to_response
from
edxmako.shortcuts
import
render_to_response
from
branding.views
import
index
from
branding.views
import
index
...
@@ -43,6 +44,7 @@ def mock_render_to_response(*args, **kwargs):
...
@@ -43,6 +44,7 @@ def mock_render_to_response(*args, **kwargs):
RENDER_MOCK
=
Mock
(
side_effect
=
mock_render_to_response
)
RENDER_MOCK
=
Mock
(
side_effect
=
mock_render_to_response
)
@attr
(
'shard_1'
)
class
AnonymousIndexPageTest
(
ModuleStoreTestCase
):
class
AnonymousIndexPageTest
(
ModuleStoreTestCase
):
"""
"""
Tests that anonymous users can access the '/' page, Need courses with start date
Tests that anonymous users can access the '/' page, Need courses with start date
...
@@ -116,6 +118,7 @@ class AnonymousIndexPageTest(ModuleStoreTestCase):
...
@@ -116,6 +118,7 @@ class AnonymousIndexPageTest(ModuleStoreTestCase):
self
.
assertEqual
(
response
.
_headers
.
get
(
"location"
)[
1
],
"/login"
)
# pylint: disable=protected-access
self
.
assertEqual
(
response
.
_headers
.
get
(
"location"
)[
1
],
"/login"
)
# pylint: disable=protected-access
@attr
(
'shard_1'
)
class
PreRequisiteCourseCatalog
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
PreRequisiteCourseCatalog
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
Test to simulate and verify fix for disappearing courses in
Test to simulate and verify fix for disappearing courses in
...
@@ -163,6 +166,7 @@ class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -163,6 +166,7 @@ class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertIn
(
'course that has pre requisite'
,
resp
.
content
)
self
.
assertIn
(
'course that has pre requisite'
,
resp
.
content
)
@attr
(
'shard_1'
)
class
IndexPageCourseCardsSortingTests
(
ModuleStoreTestCase
):
class
IndexPageCourseCardsSortingTests
(
ModuleStoreTestCase
):
"""
"""
Test for Index page course cards sorting
Test for Index page course cards sorting
...
...
lms/djangoapps/bulk_email/tests/test_course_optout.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ Unit tests for student optouts from course email
...
@@ -4,6 +4,7 @@ Unit tests for student optouts from course email
"""
"""
import
json
import
json
from
mock
import
patch
,
Mock
from
mock
import
patch
,
Mock
from
nose.plugins.attrib
import
attr
from
django.core
import
mail
from
django.core
import
mail
from
django.core.management
import
call_command
from
django.core.management
import
call_command
...
@@ -16,6 +17,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...
@@ -16,6 +17,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
@attr
(
'shard_1'
)
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
class
TestOptoutCourseEmails
(
ModuleStoreTestCase
):
class
TestOptoutCourseEmails
(
ModuleStoreTestCase
):
"""
"""
...
...
lms/djangoapps/bulk_email/tests/test_email.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ Unit tests for sending course email
...
@@ -4,6 +4,7 @@ Unit tests for sending course email
"""
"""
import
json
import
json
from
mock
import
patch
,
Mock
from
mock
import
patch
,
Mock
from
nose.plugins.attrib
import
attr
import
os
import
os
from
unittest
import
skipIf
from
unittest
import
skipIf
...
@@ -85,6 +86,7 @@ class EmailSendFromDashboardTestCase(ModuleStoreTestCase):
...
@@ -85,6 +86,7 @@ class EmailSendFromDashboardTestCase(ModuleStoreTestCase):
}
}
@attr
(
'shard_1'
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
class
TestEmailSendFromDashboardMockedHtmlToText
(
EmailSendFromDashboardTestCase
):
class
TestEmailSendFromDashboardMockedHtmlToText
(
EmailSendFromDashboardTestCase
):
...
@@ -313,6 +315,7 @@ class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase)
...
@@ -313,6 +315,7 @@ class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase)
self
.
assertItemsEqual
(
outbox_contents
,
should_send_contents
)
self
.
assertItemsEqual
(
outbox_contents
,
should_send_contents
)
@attr
(
'shard_1'
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
@skipIf
(
os
.
environ
.
get
(
"TRAVIS"
)
==
'true'
,
"Skip this test in Travis CI."
)
@skipIf
(
os
.
environ
.
get
(
"TRAVIS"
)
==
'true'
,
"Skip this test in Travis CI."
)
class
TestEmailSendFromDashboard
(
EmailSendFromDashboardTestCase
):
class
TestEmailSendFromDashboard
(
EmailSendFromDashboardTestCase
):
...
...
lms/djangoapps/bulk_email/tests/test_err_handling.py
View file @
ddb1ae66
...
@@ -11,6 +11,7 @@ from django.core.urlresolvers import reverse
...
@@ -11,6 +11,7 @@ from django.core.urlresolvers import reverse
from
django.db
import
DatabaseError
from
django.db
import
DatabaseError
import
json
import
json
from
mock
import
patch
,
Mock
from
mock
import
patch
,
Mock
from
nose.plugins.attrib
import
attr
from
smtplib
import
SMTPDataError
,
SMTPServerDisconnected
,
SMTPConnectError
from
smtplib
import
SMTPDataError
,
SMTPServerDisconnected
,
SMTPConnectError
from
bulk_email.models
import
CourseEmail
,
SEND_TO_ALL
from
bulk_email.models
import
CourseEmail
,
SEND_TO_ALL
...
@@ -35,6 +36,7 @@ class EmailTestException(Exception):
...
@@ -35,6 +36,7 @@ class EmailTestException(Exception):
pass
pass
@attr
(
'shard_1'
)
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
class
TestEmailErrors
(
ModuleStoreTestCase
):
class
TestEmailErrors
(
ModuleStoreTestCase
):
...
...
lms/djangoapps/bulk_email/tests/test_forms.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ Unit tests for bulk-email-related forms.
...
@@ -4,6 +4,7 @@ Unit tests for bulk-email-related forms.
"""
"""
from
django.conf
import
settings
from
django.conf
import
settings
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
bulk_email.models
import
CourseAuthorization
,
CourseEmailTemplate
from
bulk_email.models
import
CourseAuthorization
,
CourseEmailTemplate
from
bulk_email.forms
import
CourseAuthorizationAdminForm
,
CourseEmailTemplateForm
from
bulk_email.forms
import
CourseAuthorizationAdminForm
,
CourseEmailTemplateForm
...
@@ -15,6 +16,7 @@ from xmodule.modulestore.django import modulestore
...
@@ -15,6 +16,7 @@ from xmodule.modulestore.django import modulestore
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
@attr
(
'shard_1'
)
class
CourseAuthorizationFormTest
(
ModuleStoreTestCase
):
class
CourseAuthorizationFormTest
(
ModuleStoreTestCase
):
"""Test the CourseAuthorizationAdminForm form for Mongo-backed courses."""
"""Test the CourseAuthorizationAdminForm form for Mongo-backed courses."""
...
...
lms/djangoapps/bulk_email/tests/test_models.py
View file @
ddb1ae66
...
@@ -8,11 +8,13 @@ from django.conf import settings
...
@@ -8,11 +8,13 @@ from django.conf import settings
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
from
mock
import
patch
,
Mock
from
mock
import
patch
,
Mock
from
nose.plugins.attrib
import
attr
from
bulk_email.models
import
CourseEmail
,
SEND_TO_STAFF
,
CourseEmailTemplate
,
CourseAuthorization
from
bulk_email.models
import
CourseEmail
,
SEND_TO_STAFF
,
CourseEmailTemplate
,
CourseAuthorization
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
@attr
(
'shard_1'
)
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
class
CourseEmailTest
(
TestCase
):
class
CourseEmailTest
(
TestCase
):
"""Test the CourseEmail model."""
"""Test the CourseEmail model."""
...
@@ -57,6 +59,7 @@ class CourseEmailTest(TestCase):
...
@@ -57,6 +59,7 @@ class CourseEmailTest(TestCase):
CourseEmail
.
create
(
course_id
,
sender
,
to_option
,
subject
,
html_message
)
CourseEmail
.
create
(
course_id
,
sender
,
to_option
,
subject
,
html_message
)
@attr
(
'shard_1'
)
class
NoCourseEmailTemplateTest
(
TestCase
):
class
NoCourseEmailTemplateTest
(
TestCase
):
"""Test the CourseEmailTemplate model without loading the template data."""
"""Test the CourseEmailTemplate model without loading the template data."""
...
@@ -65,6 +68,7 @@ class NoCourseEmailTemplateTest(TestCase):
...
@@ -65,6 +68,7 @@ class NoCourseEmailTemplateTest(TestCase):
CourseEmailTemplate
.
get_template
()
CourseEmailTemplate
.
get_template
()
@attr
(
'shard_1'
)
class
CourseEmailTemplateTest
(
TestCase
):
class
CourseEmailTemplateTest
(
TestCase
):
"""Test the CourseEmailTemplate model."""
"""Test the CourseEmailTemplate model."""
...
@@ -134,6 +138,7 @@ class CourseEmailTemplateTest(TestCase):
...
@@ -134,6 +138,7 @@ class CourseEmailTemplateTest(TestCase):
template
.
render_plaintext
(
"My new plain text."
,
context
)
template
.
render_plaintext
(
"My new plain text."
,
context
)
@attr
(
'shard_1'
)
class
CourseAuthorizationTest
(
TestCase
):
class
CourseAuthorizationTest
(
TestCase
):
"""Test the CourseAuthorization model."""
"""Test the CourseAuthorization model."""
...
...
lms/djangoapps/bulk_email/tests/test_tasks.py
View file @
ddb1ae66
...
@@ -9,6 +9,7 @@ import json
...
@@ -9,6 +9,7 @@ import json
from
uuid
import
uuid4
from
uuid
import
uuid4
from
itertools
import
cycle
,
chain
,
repeat
from
itertools
import
cycle
,
chain
,
repeat
from
mock
import
patch
,
Mock
from
mock
import
patch
,
Mock
from
nose.plugins.attrib
import
attr
from
smtplib
import
SMTPServerDisconnected
,
SMTPDataError
,
SMTPConnectError
,
SMTPAuthenticationError
from
smtplib
import
SMTPServerDisconnected
,
SMTPDataError
,
SMTPConnectError
,
SMTPAuthenticationError
from
boto.ses.exceptions
import
(
from
boto.ses.exceptions
import
(
SESAddressNotVerifiedError
,
SESAddressNotVerifiedError
,
...
@@ -71,6 +72,7 @@ def my_update_subtask_status(entry_id, current_task_id, new_subtask_status):
...
@@ -71,6 +72,7 @@ def my_update_subtask_status(entry_id, current_task_id, new_subtask_status):
update_subtask_status
(
entry_id
,
current_task_id
,
new_subtask_status
)
update_subtask_status
(
entry_id
,
current_task_id
,
new_subtask_status
)
@attr
(
'shard_1'
)
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
class
TestBulkEmailInstructorTask
(
InstructorTaskCourseTestCase
):
class
TestBulkEmailInstructorTask
(
InstructorTaskCourseTestCase
):
"""Tests instructor task that send bulk email."""
"""Tests instructor task that send bulk email."""
...
...
lms/djangoapps/ccx/tests/test_models.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ tests for the models
...
@@ -4,6 +4,7 @@ tests for the models
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
from
django.utils.timezone
import
UTC
from
django.utils.timezone
import
UTC
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
student.models
import
CourseEnrollment
# pylint: disable=import-error
from
student.models
import
CourseEnrollment
# pylint: disable=import-error
from
student.roles
import
CourseCcxCoachRole
# pylint: disable=import-error
from
student.roles
import
CourseCcxCoachRole
# pylint: disable=import-error
from
student.tests.factories
import
(
# pylint: disable=import-error
from
student.tests.factories
import
(
# pylint: disable=import-error
...
@@ -29,6 +30,7 @@ from ..models import (
...
@@ -29,6 +30,7 @@ from ..models import (
from
..overrides
import
override_field_for_ccx
from
..overrides
import
override_field_for_ccx
@attr
(
'shard_1'
)
class
TestCcxMembership
(
ModuleStoreTestCase
):
class
TestCcxMembership
(
ModuleStoreTestCase
):
"""Unit tests for the CcxMembership model
"""Unit tests for the CcxMembership model
"""
"""
...
@@ -135,6 +137,7 @@ class TestCcxMembership(ModuleStoreTestCase):
...
@@ -135,6 +137,7 @@ class TestCcxMembership(ModuleStoreTestCase):
self
.
assertTrue
(
self
.
has_ccx_future_membership
(
user
))
self
.
assertTrue
(
self
.
has_ccx_future_membership
(
user
))
@attr
(
'shard_1'
)
class
TestCCX
(
ModuleStoreTestCase
):
class
TestCCX
(
ModuleStoreTestCase
):
"""Unit tests for the CustomCourseForEdX model
"""Unit tests for the CustomCourseForEdX model
"""
"""
...
...
lms/djangoapps/ccx/tests/test_overrides.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ tests for overrides
...
@@ -4,6 +4,7 @@ tests for overrides
import
datetime
import
datetime
import
mock
import
mock
import
pytz
import
pytz
from
nose.plugins.attrib
import
attr
from
courseware.field_overrides
import
OverrideFieldData
# pylint: disable=import-error
from
courseware.field_overrides
import
OverrideFieldData
# pylint: disable=import-error
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
...
@@ -17,6 +18,7 @@ from ..overrides import override_field_for_ccx
...
@@ -17,6 +18,7 @@ from ..overrides import override_field_for_ccx
from
.test_views
import
flatten
,
iter_blocks
from
.test_views
import
flatten
,
iter_blocks
@attr
(
'shard_1'
)
@override_settings
(
FIELD_OVERRIDE_PROVIDERS
=
(
@override_settings
(
FIELD_OVERRIDE_PROVIDERS
=
(
'ccx.overrides.CustomCoursesForEdxOverrideProvider'
,))
'ccx.overrides.CustomCoursesForEdxOverrideProvider'
,))
class
TestFieldOverrides
(
ModuleStoreTestCase
):
class
TestFieldOverrides
(
ModuleStoreTestCase
):
...
...
lms/djangoapps/ccx/tests/test_utils.py
View file @
ddb1ae66
"""
"""
test utils
test utils
"""
"""
from
nose.plugins.attrib
import
attr
from
ccx.models
import
(
# pylint: disable=import-error
from
ccx.models
import
(
# pylint: disable=import-error
CcxMembership
,
CcxMembership
,
CcxFutureMembership
,
CcxFutureMembership
,
...
@@ -21,6 +23,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...
@@ -21,6 +23,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
@attr
(
'shard_1'
)
class
TestEmailEnrollmentState
(
ModuleStoreTestCase
):
class
TestEmailEnrollmentState
(
ModuleStoreTestCase
):
"""unit tests for the EmailEnrollmentState class
"""unit tests for the EmailEnrollmentState class
"""
"""
...
@@ -120,6 +123,7 @@ class TestEmailEnrollmentState(ModuleStoreTestCase):
...
@@ -120,6 +123,7 @@ class TestEmailEnrollmentState(ModuleStoreTestCase):
self
.
assertTrue
(
member
in
representation
)
self
.
assertTrue
(
member
in
representation
)
@attr
(
'shard_1'
)
# TODO: deal with changes in behavior for auto_enroll
# TODO: deal with changes in behavior for auto_enroll
class
TestGetEmailParams
(
ModuleStoreTestCase
):
class
TestGetEmailParams
(
ModuleStoreTestCase
):
"""tests for ccx.utils.get_email_params
"""tests for ccx.utils.get_email_params
...
@@ -176,6 +180,7 @@ class TestGetEmailParams(ModuleStoreTestCase):
...
@@ -176,6 +180,7 @@ class TestGetEmailParams(ModuleStoreTestCase):
self
.
assertTrue
(
auto
[
'auto_enroll'
])
self
.
assertTrue
(
auto
[
'auto_enroll'
])
@attr
(
'shard_1'
)
# TODO: deal with changes in behavior for auto_enroll
# TODO: deal with changes in behavior for auto_enroll
class
TestEnrollEmail
(
ModuleStoreTestCase
):
class
TestEnrollEmail
(
ModuleStoreTestCase
):
"""tests for the enroll_email function from ccx.utils
"""tests for the enroll_email function from ccx.utils
...
@@ -356,6 +361,7 @@ class TestEnrollEmail(ModuleStoreTestCase):
...
@@ -356,6 +361,7 @@ class TestEnrollEmail(ModuleStoreTestCase):
self
.
assertEqual
(
self
.
outbox
,
[])
self
.
assertEqual
(
self
.
outbox
,
[])
@attr
(
'shard_1'
)
# TODO: deal with changes in behavior for auto_enroll
# TODO: deal with changes in behavior for auto_enroll
class
TestUnenrollEmail
(
ModuleStoreTestCase
):
class
TestUnenrollEmail
(
ModuleStoreTestCase
):
"""Tests for the unenroll_email function from ccx.utils"""
"""Tests for the unenroll_email function from ccx.utils"""
...
@@ -504,6 +510,7 @@ class TestUnenrollEmail(ModuleStoreTestCase):
...
@@ -504,6 +510,7 @@ class TestUnenrollEmail(ModuleStoreTestCase):
self
.
assertEqual
(
self
.
outbox
,
[])
self
.
assertEqual
(
self
.
outbox
,
[])
@attr
(
'shard_1'
)
class
TestUserCCXList
(
ModuleStoreTestCase
):
class
TestUserCCXList
(
ModuleStoreTestCase
):
"""Unit tests for ccx.utils.get_all_ccx_for_user"""
"""Unit tests for ccx.utils.get_all_ccx_for_user"""
...
...
lms/djangoapps/ccx/tests/test_views.py
View file @
ddb1ae66
...
@@ -6,6 +6,7 @@ import json
...
@@ -6,6 +6,7 @@ import json
import
re
import
re
import
pytz
import
pytz
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
capa.tests.response_xml_factory
import
StringResponseXMLFactory
from
capa.tests.response_xml_factory
import
StringResponseXMLFactory
from
courseware.field_overrides
import
OverrideFieldData
# pylint: disable=import-error
from
courseware.field_overrides
import
OverrideFieldData
# pylint: disable=import-error
...
@@ -55,6 +56,7 @@ def intercept_renderer(path, context):
...
@@ -55,6 +56,7 @@ def intercept_renderer(path, context):
return
response
return
response
@attr
(
'shard_1'
)
class
TestCoachDashboard
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestCoachDashboard
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
Tests for Custom Courses views.
Tests for Custom Courses views.
...
@@ -433,6 +435,7 @@ def patched_get_children(self, usage_key_filter=None): # pylint: disable=missin
...
@@ -433,6 +435,7 @@ def patched_get_children(self, usage_key_filter=None): # pylint: disable=missin
return
list
(
iter_children
())
return
list
(
iter_children
())
@attr
(
'shard_1'
)
@override_settings
(
FIELD_OVERRIDE_PROVIDERS
=
(
@override_settings
(
FIELD_OVERRIDE_PROVIDERS
=
(
'ccx.overrides.CustomCoursesForEdxOverrideProvider'
,))
'ccx.overrides.CustomCoursesForEdxOverrideProvider'
,))
@patch
(
'xmodule.x_module.XModuleMixin.get_children'
,
patched_get_children
,
spec
=
True
)
@patch
(
'xmodule.x_module.XModuleMixin.get_children'
,
patched_get_children
,
spec
=
True
)
...
@@ -584,6 +587,7 @@ class TestCCXGrades(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -584,6 +587,7 @@ class TestCCXGrades(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertEqual
(
len
(
grades
[
'section_breakdown'
]),
4
)
self
.
assertEqual
(
len
(
grades
[
'section_breakdown'
]),
4
)
@attr
(
'shard_1'
)
class
TestSwitchActiveCCX
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestSwitchActiveCCX
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""Verify the view for switching which CCX is active, if any
"""Verify the view for switching which CCX is active, if any
"""
"""
...
...
lms/djangoapps/certificates/tests/test_api.py
View file @
ddb1ae66
...
@@ -5,6 +5,7 @@ import ddt
...
@@ -5,6 +5,7 @@ import ddt
from
django.test
import
TestCase
,
RequestFactory
from
django.test
import
TestCase
,
RequestFactory
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
...
@@ -25,6 +26,7 @@ from certificates.queue import XQueueCertInterface, XQueueAddToQueueError
...
@@ -25,6 +26,7 @@ from certificates.queue import XQueueCertInterface, XQueueAddToQueueError
from
certificates.tests.factories
import
GeneratedCertificateFactory
from
certificates.tests.factories
import
GeneratedCertificateFactory
@attr
(
'shard_1'
)
class
CertificateDownloadableStatusTests
(
ModuleStoreTestCase
):
class
CertificateDownloadableStatusTests
(
ModuleStoreTestCase
):
"""Tests for the `certificate_downloadable_status` helper function. """
"""Tests for the `certificate_downloadable_status` helper function. """
...
@@ -104,6 +106,7 @@ class CertificateDownloadableStatusTests(ModuleStoreTestCase):
...
@@ -104,6 +106,7 @@ class CertificateDownloadableStatusTests(ModuleStoreTestCase):
)
)
@attr
(
'shard_1'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
class
GenerateUserCertificatesTest
(
ModuleStoreTestCase
):
class
GenerateUserCertificatesTest
(
ModuleStoreTestCase
):
"""Tests for generating certificates for students. """
"""Tests for generating certificates for students. """
...
@@ -164,6 +167,7 @@ class GenerateUserCertificatesTest(ModuleStoreTestCase):
...
@@ -164,6 +167,7 @@ class GenerateUserCertificatesTest(ModuleStoreTestCase):
yield
mock_send_to_queue
yield
mock_send_to_queue
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
CertificateGenerationEnabledTest
(
TestCase
):
class
CertificateGenerationEnabledTest
(
TestCase
):
"""Test enabling/disabling self-generated certificates for a course. """
"""Test enabling/disabling self-generated certificates for a course. """
...
@@ -225,6 +229,7 @@ class CertificateGenerationEnabledTest(TestCase):
...
@@ -225,6 +229,7 @@ class CertificateGenerationEnabledTest(TestCase):
self
.
assertEqual
(
expect_enabled
,
actual_enabled
)
self
.
assertEqual
(
expect_enabled
,
actual_enabled
)
@attr
(
'shard_1'
)
class
GenerateExampleCertificatesTest
(
TestCase
):
class
GenerateExampleCertificatesTest
(
TestCase
):
"""Test generation of example certificates. """
"""Test generation of example certificates. """
...
...
lms/djangoapps/certificates/tests/test_create_fake_cert.py
View file @
ddb1ae66
"""Tests for the create_fake_certs management command. """
"""Tests for the create_fake_certs management command. """
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.core.management.base
import
CommandError
from
django.core.management.base
import
CommandError
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
...
@@ -8,6 +9,7 @@ from certificates.management.commands import create_fake_cert
...
@@ -8,6 +9,7 @@ from certificates.management.commands import create_fake_cert
from
certificates.models
import
GeneratedCertificate
from
certificates.models
import
GeneratedCertificate
@attr
(
'shard_1'
)
class
CreateFakeCertTest
(
TestCase
):
class
CreateFakeCertTest
(
TestCase
):
"""Tests for the create_fake_certs management command. """
"""Tests for the create_fake_certs management command. """
...
...
lms/djangoapps/certificates/tests/test_models.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ from django.conf import settings
...
@@ -3,6 +3,7 @@ from django.conf import settings
from
django.core.exceptions
import
ValidationError
from
django.core.exceptions
import
ValidationError
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
from
certificates.models
import
(
from
certificates.models
import
(
...
@@ -15,6 +16,7 @@ FEATURES_INVALID_FILE_PATH = settings.FEATURES.copy()
...
@@ -15,6 +16,7 @@ FEATURES_INVALID_FILE_PATH = settings.FEATURES.copy()
FEATURES_INVALID_FILE_PATH
[
'CERTS_HTML_VIEW_CONFIG_PATH'
]
=
'invalid/path/to/config.json'
FEATURES_INVALID_FILE_PATH
[
'CERTS_HTML_VIEW_CONFIG_PATH'
]
=
'invalid/path/to/config.json'
@attr
(
'shard_1'
)
class
ExampleCertificateTest
(
TestCase
):
class
ExampleCertificateTest
(
TestCase
):
"""Tests for the ExampleCertificate model. """
"""Tests for the ExampleCertificate model. """
...
@@ -80,6 +82,7 @@ class ExampleCertificateTest(TestCase):
...
@@ -80,6 +82,7 @@ class ExampleCertificateTest(TestCase):
self
.
assertIs
(
result
,
None
)
self
.
assertIs
(
result
,
None
)
@attr
(
'shard_1'
)
class
CertificateHtmlViewConfigurationTest
(
TestCase
):
class
CertificateHtmlViewConfigurationTest
(
TestCase
):
"""
"""
Test the CertificateHtmlViewConfiguration model.
Test the CertificateHtmlViewConfiguration model.
...
...
lms/djangoapps/certificates/tests/test_queue.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
from
contextlib
import
contextmanager
from
contextlib
import
contextmanager
import
json
import
json
from
mock
import
patch
,
Mock
from
mock
import
patch
,
Mock
from
nose.plugins.attrib
import
attr
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
...
@@ -24,6 +25,7 @@ from certificates.queue import XQueueCertInterface
...
@@ -24,6 +25,7 @@ from certificates.queue import XQueueCertInterface
from
certificates.models
import
ExampleCertificateSet
,
ExampleCertificate
from
certificates.models
import
ExampleCertificateSet
,
ExampleCertificate
@attr
(
'shard_1'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
class
XQueueCertInterfaceAddCertificateTest
(
ModuleStoreTestCase
):
class
XQueueCertInterfaceAddCertificateTest
(
ModuleStoreTestCase
):
"""Test the "add to queue" operation of the XQueue interface. """
"""Test the "add to queue" operation of the XQueue interface. """
...
@@ -53,6 +55,7 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase):
...
@@ -53,6 +55,7 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase):
self
.
assertIn
(
'https://edx.org/update_certificate?key='
,
actual_header
[
'lms_callback_url'
])
self
.
assertIn
(
'https://edx.org/update_certificate?key='
,
actual_header
[
'lms_callback_url'
])
@attr
(
'shard_1'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
class
XQueueCertInterfaceExampleCertificateTest
(
TestCase
):
class
XQueueCertInterfaceExampleCertificateTest
(
TestCase
):
"""Tests for the XQueue interface for certificate generation. """
"""Tests for the XQueue interface for certificate generation. """
...
...
lms/djangoapps/certificates/tests/test_resubmit_error_certificates.py
View file @
ddb1ae66
"""Tests for the resubmit_error_certificates management command. """
"""Tests for the resubmit_error_certificates management command. """
import
ddt
import
ddt
from
django.core.management.base
import
CommandError
from
django.core.management.base
import
CommandError
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -10,6 +11,7 @@ from certificates.management.commands import resubmit_error_certificates
...
@@ -10,6 +11,7 @@ from certificates.management.commands import resubmit_error_certificates
from
certificates.models
import
GeneratedCertificate
,
CertificateStatuses
from
certificates.models
import
GeneratedCertificate
,
CertificateStatuses
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
ResubmitErrorCertificatesTest
(
ModuleStoreTestCase
):
class
ResubmitErrorCertificatesTest
(
ModuleStoreTestCase
):
"""Tests for the resubmit_error_certificates management command. """
"""Tests for the resubmit_error_certificates management command. """
...
...
lms/djangoapps/certificates/tests/test_views.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
import
json
import
json
import
ddt
import
ddt
from
uuid
import
uuid4
from
uuid
import
uuid4
from
nose.plugins.attrib
import
attr
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.cache
import
cache
from
django.core.cache
import
cache
...
@@ -26,6 +27,7 @@ FEATURES_WITH_CERTS_DISABLED = settings.FEATURES.copy()
...
@@ -26,6 +27,7 @@ FEATURES_WITH_CERTS_DISABLED = settings.FEATURES.copy()
FEATURES_WITH_CERTS_DISABLED
[
'CERTIFICATES_HTML_VIEW'
]
=
False
FEATURES_WITH_CERTS_DISABLED
[
'CERTIFICATES_HTML_VIEW'
]
=
False
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
UpdateExampleCertificateViewTest
(
TestCase
):
class
UpdateExampleCertificateViewTest
(
TestCase
):
"""Tests for the XQueue callback that updates example certificates. """
"""Tests for the XQueue callback that updates example certificates. """
...
@@ -167,6 +169,7 @@ class UpdateExampleCertificateViewTest(TestCase):
...
@@ -167,6 +169,7 @@ class UpdateExampleCertificateViewTest(TestCase):
self
.
assertEqual
(
content
[
'return_code'
],
0
)
self
.
assertEqual
(
content
[
'return_code'
],
0
)
@attr
(
'shard_1'
)
class
CertificatesViewsTests
(
ModuleStoreTestCase
):
class
CertificatesViewsTests
(
ModuleStoreTestCase
):
"""
"""
Tests for the manual refund page
Tests for the manual refund page
...
...
lms/djangoapps/certificates/tests/tests.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ Tests for the certificates models.
...
@@ -4,6 +4,7 @@ Tests for the certificates models.
from
ddt
import
ddt
,
data
,
unpack
from
ddt
import
ddt
,
data
,
unpack
from
mock
import
patch
from
mock
import
patch
from
django.conf
import
settings
from
django.conf
import
settings
from
nose.plugins.attrib
import
attr
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -24,6 +25,7 @@ from util.milestones_helpers import (
...
@@ -24,6 +25,7 @@ from util.milestones_helpers import (
)
)
@attr
(
'shard_1'
)
@ddt
@ddt
class
CertificatesModelTest
(
ModuleStoreTestCase
):
class
CertificatesModelTest
(
ModuleStoreTestCase
):
"""
"""
...
...
lms/djangoapps/class_dashboard/tests/test_dashboard_data.py
View file @
ddb1ae66
...
@@ -7,6 +7,7 @@ import json
...
@@ -7,6 +7,7 @@ import json
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test.client
import
RequestFactory
from
django.test.client
import
RequestFactory
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
capa.tests.response_xml_factory
import
StringResponseXMLFactory
from
capa.tests.response_xml_factory
import
StringResponseXMLFactory
from
courseware.tests.factories
import
StudentModuleFactory
from
courseware.tests.factories
import
StudentModuleFactory
...
@@ -26,6 +27,7 @@ from class_dashboard.views import has_instructor_access_for_class
...
@@ -26,6 +27,7 @@ from class_dashboard.views import has_instructor_access_for_class
USER_COUNT
=
11
USER_COUNT
=
11
@attr
(
'shard_1'
)
class
TestGetProblemGradeDistribution
(
ModuleStoreTestCase
):
class
TestGetProblemGradeDistribution
(
ModuleStoreTestCase
):
"""
"""
Tests related to class_dashboard/dashboard_data.py
Tests related to class_dashboard/dashboard_data.py
...
...
lms/djangoapps/class_dashboard/tests/test_views.py
View file @
ddb1ae66
...
@@ -5,6 +5,7 @@ import json
...
@@ -5,6 +5,7 @@ import json
from
django.test.client
import
RequestFactory
from
django.test.client
import
RequestFactory
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -12,6 +13,7 @@ from class_dashboard import views
...
@@ -12,6 +13,7 @@ from class_dashboard import views
from
student.tests.factories
import
AdminFactory
from
student.tests.factories
import
AdminFactory
@attr
(
'shard_1'
)
class
TestViews
(
ModuleStoreTestCase
):
class
TestViews
(
ModuleStoreTestCase
):
"""
"""
Tests related to class_dashboard/views.py
Tests related to class_dashboard/views.py
...
...
lms/djangoapps/commerce/tests/test_views.py
View file @
ddb1ae66
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
json
import
json
from
uuid
import
uuid4
from
uuid
import
uuid4
from
nose.plugins.attrib
import
attr
from
ddt
import
ddt
,
data
from
ddt
import
ddt
,
data
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -33,6 +34,7 @@ class UserMixin(object):
...
@@ -33,6 +34,7 @@ class UserMixin(object):
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
'test'
)
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
'test'
)
@attr
(
'shard_1'
)
@ddt
@ddt
@override_settings
(
ECOMMERCE_API_URL
=
TEST_API_URL
,
ECOMMERCE_API_SIGNING_KEY
=
TEST_API_SIGNING_KEY
)
@override_settings
(
ECOMMERCE_API_URL
=
TEST_API_URL
,
ECOMMERCE_API_SIGNING_KEY
=
TEST_API_SIGNING_KEY
)
class
BasketsViewTests
(
EnrollmentEventTestMixin
,
UserMixin
,
ModuleStoreTestCase
):
class
BasketsViewTests
(
EnrollmentEventTestMixin
,
UserMixin
,
ModuleStoreTestCase
):
...
@@ -303,6 +305,7 @@ class OrdersViewTests(BasketsViewTests):
...
@@ -303,6 +305,7 @@ class OrdersViewTests(BasketsViewTests):
self
.
url
=
reverse
(
'commerce:orders'
)
self
.
url
=
reverse
(
'commerce:orders'
)
@attr
(
'shard_1'
)
@override_settings
(
ECOMMERCE_API_URL
=
TEST_API_URL
,
ECOMMERCE_API_SIGNING_KEY
=
TEST_API_SIGNING_KEY
)
@override_settings
(
ECOMMERCE_API_URL
=
TEST_API_URL
,
ECOMMERCE_API_SIGNING_KEY
=
TEST_API_SIGNING_KEY
)
class
BasketOrderViewTests
(
UserMixin
,
TestCase
):
class
BasketOrderViewTests
(
UserMixin
,
TestCase
):
""" Tests for the basket order view. """
""" Tests for the basket order view. """
...
@@ -337,6 +340,7 @@ class BasketOrderViewTests(UserMixin, TestCase):
...
@@ -337,6 +340,7 @@ class BasketOrderViewTests(UserMixin, TestCase):
self
.
assertEqual
(
response
.
status_code
,
403
)
self
.
assertEqual
(
response
.
status_code
,
403
)
@attr
(
'shard_1'
)
class
ReceiptViewTests
(
TestCase
):
class
ReceiptViewTests
(
TestCase
):
""" Tests for the receipt view. """
""" Tests for the receipt view. """
...
...
lms/djangoapps/course_wiki/tests/test_access.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ Tests for wiki permissions
...
@@ -3,6 +3,7 @@ Tests for wiki permissions
"""
"""
from
django.contrib.auth.models
import
Group
from
django.contrib.auth.models
import
Group
from
nose.plugins.attrib
import
attr
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -51,6 +52,7 @@ class TestWikiAccessBase(ModuleStoreTestCase):
...
@@ -51,6 +52,7 @@ class TestWikiAccessBase(ModuleStoreTestCase):
]
]
@attr
(
'shard_1'
)
class
TestWikiAccess
(
TestWikiAccessBase
):
class
TestWikiAccess
(
TestWikiAccessBase
):
"""Test wiki access for course staff."""
"""Test wiki access for course staff."""
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -111,6 +113,7 @@ class TestWikiAccess(TestWikiAccessBase):
...
@@ -111,6 +113,7 @@ class TestWikiAccess(TestWikiAccessBase):
self
.
assertFalse
(
user_is_article_course_staff
(
course_staff
,
self
.
wiki_310b
.
article
))
self
.
assertFalse
(
user_is_article_course_staff
(
course_staff
,
self
.
wiki_310b
.
article
))
@attr
(
'shard_1'
)
class
TestWikiAccessForStudent
(
TestWikiAccessBase
):
class
TestWikiAccessForStudent
(
TestWikiAccessBase
):
"""Test access for students."""
"""Test access for students."""
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -126,6 +129,7 @@ class TestWikiAccessForStudent(TestWikiAccessBase):
...
@@ -126,6 +129,7 @@ class TestWikiAccessForStudent(TestWikiAccessBase):
self
.
assertFalse
(
user_is_article_course_staff
(
self
.
student
,
page
.
article
))
self
.
assertFalse
(
user_is_article_course_staff
(
self
.
student
,
page
.
article
))
@attr
(
'shard_1'
)
class
TestWikiAccessForNumericalCourseNumber
(
TestWikiAccessBase
):
class
TestWikiAccessForNumericalCourseNumber
(
TestWikiAccessBase
):
"""Test staff has access if course number is numerical and wiki slug has an underscore appended."""
"""Test staff has access if course number is numerical and wiki slug has an underscore appended."""
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -145,6 +149,7 @@ class TestWikiAccessForNumericalCourseNumber(TestWikiAccessBase):
...
@@ -145,6 +149,7 @@ class TestWikiAccessForNumericalCourseNumber(TestWikiAccessBase):
self
.
assertTrue
(
user_is_article_course_staff
(
course_staff
,
page
.
article
))
self
.
assertTrue
(
user_is_article_course_staff
(
course_staff
,
page
.
article
))
@attr
(
'shard_1'
)
class
TestWikiAccessForOldFormatCourseStaffGroups
(
TestWikiAccessBase
):
class
TestWikiAccessForOldFormatCourseStaffGroups
(
TestWikiAccessBase
):
"""Test staff has access if course group has old format."""
"""Test staff has access if course group has old format."""
def
setUp
(
self
):
def
setUp
(
self
):
...
...
lms/djangoapps/course_wiki/tests/test_middleware.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ Tests for wiki middleware.
...
@@ -3,6 +3,7 @@ Tests for wiki middleware.
"""
"""
from
django.test.client
import
Client
from
django.test.client
import
Client
from
nose.plugins.attrib
import
attr
from
wiki.models
import
URLPath
from
wiki.models
import
URLPath
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -12,6 +13,7 @@ from courseware.tests.factories import InstructorFactory
...
@@ -12,6 +13,7 @@ from courseware.tests.factories import InstructorFactory
from
course_wiki.views
import
get_or_create_root
from
course_wiki.views
import
get_or_create_root
@attr
(
'shard_1'
)
class
TestWikiAccessMiddleware
(
ModuleStoreTestCase
):
class
TestWikiAccessMiddleware
(
ModuleStoreTestCase
):
"""Tests for WikiAccessMiddleware."""
"""Tests for WikiAccessMiddleware."""
...
...
lms/djangoapps/course_wiki/tests/tests.py
View file @
ddb1ae66
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
nose.plugins.attrib
import
attr
from
courseware.tests.tests
import
LoginEnrollmentTestCase
from
courseware.tests.tests
import
LoginEnrollmentTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -7,6 +8,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
...
@@ -7,6 +8,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
from
mock
import
patch
from
mock
import
patch
@attr
(
'shard_1'
)
class
WikiRedirectTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
WikiRedirectTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Tests for wiki course redirection.
Tests for wiki course redirection.
...
...
lms/djangoapps/courseware/management/commands/tests/test_clean_history.py
View file @
ddb1ae66
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
fnmatch
import
fnmatch
from
mock
import
Mock
from
mock
import
Mock
from
nose.plugins.attrib
import
attr
import
os.path
import
os.path
import
textwrap
import
textwrap
...
@@ -138,6 +139,7 @@ class HistoryCleanerTest(TransactionTestCase):
...
@@ -138,6 +139,7 @@ class HistoryCleanerTest(TransactionTestCase):
self
.
assertEqual
(
self
.
parse_rows
(
rows
),
self
.
read_history
())
self
.
assertEqual
(
self
.
parse_rows
(
rows
),
self
.
read_history
())
@attr
(
'shard_1'
)
class
HistoryCleanerNoDbTest
(
HistoryCleanerTest
):
class
HistoryCleanerNoDbTest
(
HistoryCleanerTest
):
"""Tests of StudentModuleHistoryCleaner with db access mocked."""
"""Tests of StudentModuleHistoryCleaner with db access mocked."""
...
@@ -208,6 +210,7 @@ class HistoryCleanerNoDbTest(HistoryCleanerTest):
...
@@ -208,6 +210,7 @@ class HistoryCleanerNoDbTest(HistoryCleanerTest):
smhc
.
delete_history
.
assert_called_once_with
([
42
,
23
,
15
,
8
])
smhc
.
delete_history
.
assert_called_once_with
([
42
,
23
,
15
,
8
])
@attr
(
'shard_1'
)
class
HistoryCleanerWitDbTest
(
HistoryCleanerTest
):
class
HistoryCleanerWitDbTest
(
HistoryCleanerTest
):
"""Tests of StudentModuleHistoryCleaner with a real db."""
"""Tests of StudentModuleHistoryCleaner with a real db."""
...
@@ -394,6 +397,7 @@ class SmhcForTestingMain(SmhcSayStubbed):
...
@@ -394,6 +397,7 @@ class SmhcForTestingMain(SmhcSayStubbed):
self
.
say
(
"(not really committing)"
)
self
.
say
(
"(not really committing)"
)
@attr
(
'shard_1'
)
class
HistoryCleanerMainTest
(
HistoryCleanerTest
):
class
HistoryCleanerMainTest
(
HistoryCleanerTest
):
"""Tests of StudentModuleHistoryCleaner.main(), using SmhcForTestingMain."""
"""Tests of StudentModuleHistoryCleaner.main(), using SmhcForTestingMain."""
...
...
lms/djangoapps/courseware/management/commands/tests/test_dump_course.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
"""Tests for Django management commands"""
"""Tests for Django management commands"""
import
json
import
json
from
nose.plugins.attrib
import
attr
from
path
import
path
from
path
import
path
import
shutil
import
shutil
from
StringIO
import
StringIO
from
StringIO
import
StringIO
...
@@ -35,6 +36,7 @@ TEST_DATA_MIXED_XML_MODULESTORE = mixed_store_config(
...
@@ -35,6 +36,7 @@ TEST_DATA_MIXED_XML_MODULESTORE = mixed_store_config(
)
)
@attr
(
'shard_1'
)
class
CommandsTestBase
(
ModuleStoreTestCase
):
class
CommandsTestBase
(
ModuleStoreTestCase
):
"""
"""
Base class for testing different django commands.
Base class for testing different django commands.
...
...
lms/djangoapps/courseware/tests/test_about.py
View file @
ddb1ae66
...
@@ -8,6 +8,7 @@ from django.conf import settings
...
@@ -8,6 +8,7 @@ from django.conf import settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
course_modes.models
import
CourseMode
from
course_modes.models
import
CourseMode
...
@@ -32,6 +33,7 @@ REG_STR = "<form id=\"class_enroll_form\" method=\"post\" data-remote=\"true\" a
...
@@ -32,6 +33,7 @@ REG_STR = "<form id=\"class_enroll_form\" method=\"post\" data-remote=\"true\" a
SHIB_ERROR_STR
=
"The currently logged-in user account does not have permission to enroll in this course."
SHIB_ERROR_STR
=
"The currently logged-in user account does not have permission to enroll in this course."
@attr
(
'shard_1'
)
class
AboutTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
AboutTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Tests about xblock.
Tests about xblock.
...
@@ -180,6 +182,7 @@ class AboutTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -180,6 +182,7 @@ class AboutTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
@attr
(
'shard_1'
)
class
AboutTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
AboutTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Tests for the course about page
Tests for the course about page
...
@@ -211,6 +214,7 @@ class AboutTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -211,6 +214,7 @@ class AboutTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertIn
(
self
.
xml_data
,
resp
.
content
)
self
.
assertIn
(
self
.
xml_data
,
resp
.
content
)
@attr
(
'shard_1'
)
class
AboutWithCappedEnrollmentsTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
AboutWithCappedEnrollmentsTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
This test case will check the About page when a course has a capped enrollment
This test case will check the About page when a course has a capped enrollment
...
@@ -261,6 +265,7 @@ class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, ModuleStoreTes
...
@@ -261,6 +265,7 @@ class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, ModuleStoreTes
self
.
assertNotIn
(
REG_STR
,
resp
.
content
)
self
.
assertNotIn
(
REG_STR
,
resp
.
content
)
@attr
(
'shard_1'
)
class
AboutWithInvitationOnly
(
ModuleStoreTestCase
):
class
AboutWithInvitationOnly
(
ModuleStoreTestCase
):
"""
"""
This test case will check the About page when a course is invitation only.
This test case will check the About page when a course is invitation only.
...
@@ -307,6 +312,7 @@ class AboutWithInvitationOnly(ModuleStoreTestCase):
...
@@ -307,6 +312,7 @@ class AboutWithInvitationOnly(ModuleStoreTestCase):
self
.
assertIn
(
REG_STR
,
resp
.
content
)
self
.
assertIn
(
REG_STR
,
resp
.
content
)
@attr
(
'shard_1'
)
@patch.dict
(
settings
.
FEATURES
,
{
'RESTRICT_ENROLL_BY_REG_METHOD'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'RESTRICT_ENROLL_BY_REG_METHOD'
:
True
})
class
AboutTestCaseShibCourse
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
AboutTestCaseShibCourse
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
...
@@ -347,6 +353,7 @@ class AboutTestCaseShibCourse(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -347,6 +353,7 @@ class AboutTestCaseShibCourse(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertIn
(
REG_STR
,
resp
.
content
)
self
.
assertIn
(
REG_STR
,
resp
.
content
)
@attr
(
'shard_1'
)
class
AboutWithClosedEnrollment
(
ModuleStoreTestCase
):
class
AboutWithClosedEnrollment
(
ModuleStoreTestCase
):
"""
"""
This test case will check the About page for a course that has enrollment start/end
This test case will check the About page for a course that has enrollment start/end
...
@@ -390,6 +397,7 @@ class AboutWithClosedEnrollment(ModuleStoreTestCase):
...
@@ -390,6 +397,7 @@ class AboutWithClosedEnrollment(ModuleStoreTestCase):
self
.
assertNotIn
(
'<span class="important-dates-item-text">$10</span>'
,
resp
.
content
)
self
.
assertNotIn
(
'<span class="important-dates-item-text">$10</span>'
,
resp
.
content
)
@attr
(
'shard_1'
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_SHOPPING_CART'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_SHOPPING_CART'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_PAID_COURSE_REGISTRATION'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_PAID_COURSE_REGISTRATION'
:
True
})
class
AboutPurchaseCourseTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
AboutPurchaseCourseTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
...
...
lms/djangoapps/courseware/tests/test_access.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ import pytz
...
@@ -4,6 +4,7 @@ import pytz
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
mock
import
Mock
,
patch
from
mock
import
Mock
,
patch
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
import
courseware.access
as
access
import
courseware.access
as
access
...
@@ -28,6 +29,7 @@ from util.milestones_helpers import (
...
@@ -28,6 +29,7 @@ from util.milestones_helpers import (
# pylint: disable=protected-access
# pylint: disable=protected-access
@attr
(
'shard_1'
)
class
AccessTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
AccessTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Tests for the various access controls on the student dashboard
Tests for the various access controls on the student dashboard
...
@@ -368,6 +370,7 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -368,6 +370,7 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
@attr
(
'shard_1'
)
class
UserRoleTestCase
(
TestCase
):
class
UserRoleTestCase
(
TestCase
):
"""
"""
Tests for user roles.
Tests for user roles.
...
...
lms/djangoapps/courseware/tests/test_course_info.py
View file @
ddb1ae66
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
Test the course_info xblock
Test the course_info xblock
"""
"""
import
mock
import
mock
from
nose.plugins.attrib
import
attr
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
...
@@ -14,6 +15,7 @@ from student.models import CourseEnrollment
...
@@ -14,6 +15,7 @@ from student.models import CourseEnrollment
from
.helpers
import
LoginEnrollmentTestCase
from
.helpers
import
LoginEnrollmentTestCase
@attr
(
'shard_1'
)
class
CourseInfoTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
CourseInfoTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Tests for the Course Info page
Tests for the Course Info page
...
@@ -61,6 +63,7 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -61,6 +63,7 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertFalse
(
enrollment_exists
)
self
.
assertFalse
(
enrollment_exists
)
@attr
(
'shard_1'
)
class
CourseInfoTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
CourseInfoTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Tests for the Course Info page for an XML course
Tests for the Course Info page for an XML course
...
...
lms/djangoapps/courseware/tests/test_course_survey.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ Python tests for the Survey workflows
...
@@ -3,6 +3,7 @@ Python tests for the Survey workflows
"""
"""
from
collections
import
OrderedDict
from
collections
import
OrderedDict
from
nose.plugins.attrib
import
attr
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
@attr
(
'shard_1'
)
class
SurveyViewsTests
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
SurveyViewsTests
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
All tests for the views.py file
All tests for the views.py file
...
...
lms/djangoapps/courseware/tests/test_courses.py
View file @
ddb1ae66
...
@@ -5,6 +5,7 @@ Tests for course access
...
@@ -5,6 +5,7 @@ Tests for course access
import
ddt
import
ddt
import
itertools
import
itertools
import
mock
import
mock
from
nose.plugins.attrib
import
attr
from
django.conf
import
settings
from
django.conf
import
settings
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
...
@@ -34,6 +35,7 @@ CMS_BASE_TEST = 'testcms'
...
@@ -34,6 +35,7 @@ CMS_BASE_TEST = 'testcms'
TEST_DATA_DIR
=
settings
.
COMMON_TEST_DATA_ROOT
TEST_DATA_DIR
=
settings
.
COMMON_TEST_DATA_ROOT
@attr
(
'shard_1'
)
class
CoursesTest
(
ModuleStoreTestCase
):
class
CoursesTest
(
ModuleStoreTestCase
):
"""Test methods related to fetching courses."""
"""Test methods related to fetching courses."""
...
@@ -52,6 +54,7 @@ class CoursesTest(ModuleStoreTestCase):
...
@@ -52,6 +54,7 @@ class CoursesTest(ModuleStoreTestCase):
self
.
assertEqual
(
cms_url
,
get_cms_block_link
(
self
.
course
,
'course'
))
self
.
assertEqual
(
cms_url
,
get_cms_block_link
(
self
.
course
,
'course'
))
@attr
(
'shard_1'
)
class
ModuleStoreBranchSettingTest
(
ModuleStoreTestCase
):
class
ModuleStoreBranchSettingTest
(
ModuleStoreTestCase
):
"""Test methods related to the modulestore branch setting."""
"""Test methods related to the modulestore branch setting."""
@mock.patch
(
@mock.patch
(
...
@@ -77,6 +80,7 @@ class ModuleStoreBranchSettingTest(ModuleStoreTestCase):
...
@@ -77,6 +80,7 @@ class ModuleStoreBranchSettingTest(ModuleStoreTestCase):
self
.
assertEqual
(
_get_modulestore_branch_setting
(),
'fake_default_branch'
)
self
.
assertEqual
(
_get_modulestore_branch_setting
(),
'fake_default_branch'
)
@attr
(
'shard_1'
)
@override_settings
(
CMS_BASE
=
CMS_BASE_TEST
)
@override_settings
(
CMS_BASE
=
CMS_BASE_TEST
)
class
MongoCourseImageTestCase
(
ModuleStoreTestCase
):
class
MongoCourseImageTestCase
(
ModuleStoreTestCase
):
"""Tests for course image URLs when using a mongo modulestore."""
"""Tests for course image URLs when using a mongo modulestore."""
...
@@ -132,6 +136,7 @@ class MongoCourseImageTestCase(ModuleStoreTestCase):
...
@@ -132,6 +136,7 @@ class MongoCourseImageTestCase(ModuleStoreTestCase):
)
)
@attr
(
'shard_1'
)
class
XmlCourseImageTestCase
(
XModuleXmlImportTest
):
class
XmlCourseImageTestCase
(
XModuleXmlImportTest
):
"""Tests for course image URLs when using an xml modulestore."""
"""Tests for course image URLs when using an xml modulestore."""
...
@@ -149,6 +154,7 @@ class XmlCourseImageTestCase(XModuleXmlImportTest):
...
@@ -149,6 +154,7 @@ class XmlCourseImageTestCase(XModuleXmlImportTest):
self
.
assertEquals
(
course_image_url
(
course
),
u'/static/xml_test_course/before after.jpg'
)
self
.
assertEquals
(
course_image_url
(
course
),
u'/static/xml_test_course/before after.jpg'
)
@attr
(
'shard_1'
)
class
CoursesRenderTest
(
ModuleStoreTestCase
):
class
CoursesRenderTest
(
ModuleStoreTestCase
):
"""Test methods related to rendering courses content."""
"""Test methods related to rendering courses content."""
...
@@ -196,6 +202,7 @@ class CoursesRenderTest(ModuleStoreTestCase):
...
@@ -196,6 +202,7 @@ class CoursesRenderTest(ModuleStoreTestCase):
self
.
assertIn
(
"this module is temporarily unavailable"
,
course_about
)
self
.
assertIn
(
"this module is temporarily unavailable"
,
course_about
)
@attr
(
'shard_1'
)
class
XmlCoursesRenderTest
(
ModuleStoreTestCase
):
class
XmlCoursesRenderTest
(
ModuleStoreTestCase
):
"""Test methods related to rendering courses content for an XML course."""
"""Test methods related to rendering courses content for an XML course."""
MODULESTORE
=
TEST_DATA_MIXED_TOY_MODULESTORE
MODULESTORE
=
TEST_DATA_MIXED_TOY_MODULESTORE
...
@@ -219,6 +226,7 @@ class XmlCoursesRenderTest(ModuleStoreTestCase):
...
@@ -219,6 +226,7 @@ class XmlCoursesRenderTest(ModuleStoreTestCase):
self
.
assertIn
(
"this module is temporarily unavailable"
,
course_info
)
self
.
assertIn
(
"this module is temporarily unavailable"
,
course_info
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
CourseInstantiationTests
(
ModuleStoreTestCase
):
class
CourseInstantiationTests
(
ModuleStoreTestCase
):
"""
"""
...
...
lms/djangoapps/courseware/tests/test_draft_modulestore.py
View file @
ddb1ae66
from
django.test
import
TestCase
from
django.test
import
TestCase
from
nose.plugins.attrib
import
attr
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
@attr
(
'shard_1'
)
class
TestDraftModuleStore
(
TestCase
):
class
TestDraftModuleStore
(
TestCase
):
"""
"""
Test the draft modulestore
Test the draft modulestore
...
...
lms/djangoapps/courseware/tests/test_entrance_exam.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ Tests use cases related to LMS Entrance Exam behavior, such as gated content acc
...
@@ -4,6 +4,7 @@ Tests use cases related to LMS Entrance Exam behavior, such as gated content acc
from
django.conf
import
settings
from
django.conf
import
settings
from
django.test.client
import
RequestFactory
from
django.test.client
import
RequestFactory
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
nose.plugins.attrib
import
attr
from
courseware.model_data
import
FieldDataCache
from
courseware.model_data
import
FieldDataCache
from
courseware.module_render
import
get_module
,
toc_for_course
from
courseware.module_render
import
get_module
,
toc_for_course
...
@@ -34,6 +35,7 @@ from mock import patch, Mock
...
@@ -34,6 +35,7 @@ from mock import patch, Mock
import
mock
import
mock
@attr
(
'shard_1'
)
class
EntranceExamTestCases
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
EntranceExamTestCases
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Check that content is properly gated. Create a test course from scratch to mess with.
Check that content is properly gated. Create a test course from scratch to mess with.
...
...
lms/djangoapps/courseware/tests/test_favicon.py
View file @
ddb1ae66
...
@@ -5,10 +5,12 @@ from django.test import TestCase
...
@@ -5,10 +5,12 @@ from django.test import TestCase
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
import
sys
import
sys
@attr
(
'shard_1'
)
class
FaviconTestCase
(
TestCase
):
class
FaviconTestCase
(
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
lms/djangoapps/courseware/tests/test_field_overrides.py
View file @
ddb1ae66
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
Tests for `field_overrides` module.
Tests for `field_overrides` module.
"""
"""
import
unittest
import
unittest
from
nose.plugins.attrib
import
attr
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
...
@@ -18,6 +19,7 @@ from ..field_overrides import (
...
@@ -18,6 +19,7 @@ from ..field_overrides import (
TESTUSER
=
"testuser"
TESTUSER
=
"testuser"
@attr
(
'shard_1'
)
@override_settings
(
FIELD_OVERRIDE_PROVIDERS
=
(
@override_settings
(
FIELD_OVERRIDE_PROVIDERS
=
(
'courseware.tests.test_field_overrides.TestOverrideProvider'
,))
'courseware.tests.test_field_overrides.TestOverrideProvider'
,))
class
OverrideFieldDataTests
(
TestCase
):
class
OverrideFieldDataTests
(
TestCase
):
...
@@ -89,6 +91,7 @@ class OverrideFieldDataTests(TestCase):
...
@@ -89,6 +91,7 @@ class OverrideFieldDataTests(TestCase):
self
.
assertIsInstance
(
data
,
DictFieldData
)
self
.
assertIsInstance
(
data
,
DictFieldData
)
@attr
(
'shard_1'
)
class
ResolveDottedTests
(
unittest
.
TestCase
):
class
ResolveDottedTests
(
unittest
.
TestCase
):
"""
"""
Tests for `resolve_dotted`.
Tests for `resolve_dotted`.
...
...
lms/djangoapps/courseware/tests/test_footer.py
View file @
ddb1ae66
...
@@ -4,12 +4,14 @@ edx.org uses an edx footer but other instances use an Open edX footer.
...
@@ -4,12 +4,14 @@ edx.org uses an edx footer but other instances use an Open edX footer.
"""
"""
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
django.conf
import
settings
from
django.conf
import
settings
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
@attr
(
'shard_1'
)
class
TestFooter
(
TestCase
):
class
TestFooter
(
TestCase
):
SOCIAL_MEDIA_URLS
=
{
SOCIAL_MEDIA_URLS
=
{
...
...
lms/djangoapps/courseware/tests/test_grades.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ Test grade calculation.
...
@@ -3,6 +3,7 @@ Test grade calculation.
"""
"""
from
django.http
import
Http404
from
django.http
import
Http404
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
courseware.grades
import
grade
,
iterate_grades_for
from
courseware.grades
import
grade
,
iterate_grades_for
...
@@ -25,6 +26,7 @@ def _grade_with_errors(student, request, course, keep_raw_scores=False):
...
@@ -25,6 +26,7 @@ def _grade_with_errors(student, request, course, keep_raw_scores=False):
return
grade
(
student
,
request
,
course
,
keep_raw_scores
=
keep_raw_scores
)
return
grade
(
student
,
request
,
course
,
keep_raw_scores
=
keep_raw_scores
)
@attr
(
'shard_1'
)
class
TestGradeIteration
(
ModuleStoreTestCase
):
class
TestGradeIteration
(
ModuleStoreTestCase
):
"""
"""
Test iteration through student gradesets.
Test iteration through student gradesets.
...
...
lms/djangoapps/courseware/tests/test_group_access.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ access control rules.
...
@@ -4,6 +4,7 @@ access control rules.
"""
"""
import
ddt
import
ddt
from
nose.plugins.attrib
import
attr
from
stevedore.extension
import
Extension
,
ExtensionManager
from
stevedore.extension
import
Extension
,
ExtensionManager
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -50,6 +51,7 @@ def resolve_attrs(test_method):
...
@@ -50,6 +51,7 @@ def resolve_attrs(test_method):
return
_wrapper
return
_wrapper
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
GroupAccessTestCase
(
ModuleStoreTestCase
):
class
GroupAccessTestCase
(
ModuleStoreTestCase
):
"""
"""
...
...
lms/djangoapps/courseware/tests/test_i18n.py
View file @
ddb1ae66
...
@@ -2,11 +2,13 @@
...
@@ -2,11 +2,13 @@
Tests i18n in courseware
Tests i18n in courseware
"""
"""
import
re
import
re
from
nose.plugins.attrib
import
attr
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
@attr
(
'shard_1'
)
@override_settings
(
LANGUAGES
=
((
'eo'
,
'Esperanto'
),))
@override_settings
(
LANGUAGES
=
((
'eo'
,
'Esperanto'
),))
class
I18nTestCase
(
TestCase
):
class
I18nTestCase
(
TestCase
):
"""
"""
...
...
lms/djangoapps/courseware/tests/test_lti_integration.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
from
collections
import
OrderedDict
from
collections
import
OrderedDict
import
json
import
json
import
mock
import
mock
from
nose.plugins.attrib
import
attr
import
oauthlib
import
oauthlib
import
urllib
import
urllib
...
@@ -17,6 +18,7 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
...
@@ -17,6 +18,7 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from
xmodule.x_module
import
STUDENT_VIEW
from
xmodule.x_module
import
STUDENT_VIEW
@attr
(
'shard_1'
)
class
TestLTI
(
BaseTestXmodule
):
class
TestLTI
(
BaseTestXmodule
):
"""
"""
Integration test for lti xmodule.
Integration test for lti xmodule.
...
@@ -122,6 +124,7 @@ class TestLTI(BaseTestXmodule):
...
@@ -122,6 +124,7 @@ class TestLTI(BaseTestXmodule):
self
.
assertEqual
(
generated_content
,
expected_content
)
self
.
assertEqual
(
generated_content
,
expected_content
)
@attr
(
'shard_1'
)
class
TestLTIModuleListing
(
ModuleStoreTestCase
):
class
TestLTIModuleListing
(
ModuleStoreTestCase
):
"""
"""
a test for the rest endpoint that lists LTI modules in a course
a test for the rest endpoint that lists LTI modules in a course
...
...
lms/djangoapps/courseware/tests/test_masquerade.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ Unit tests for masquerade.
...
@@ -3,6 +3,7 @@ Unit tests for masquerade.
"""
"""
import
json
import
json
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
datetime
import
datetime
from
datetime
import
datetime
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -121,6 +122,7 @@ class MasqueradeTestCase(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -121,6 +122,7 @@ class MasqueradeTestCase(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertEqual
(
show_answer_expected
,
"Show Answer"
in
problem_html
)
self
.
assertEqual
(
show_answer_expected
,
"Show Answer"
in
problem_html
)
@attr
(
'shard_1'
)
class
NormalStudentVisibilityTest
(
MasqueradeTestCase
):
class
NormalStudentVisibilityTest
(
MasqueradeTestCase
):
"""
"""
Verify the course displays as expected for a "normal" student (to ensure test setup is correct).
Verify the course displays as expected for a "normal" student (to ensure test setup is correct).
...
@@ -175,6 +177,7 @@ class StaffMasqueradeTestCase(MasqueradeTestCase):
...
@@ -175,6 +177,7 @@ class StaffMasqueradeTestCase(MasqueradeTestCase):
return
response
return
response
@attr
(
'shard_1'
)
class
TestStaffMasqueradeAsStudent
(
StaffMasqueradeTestCase
):
class
TestStaffMasqueradeAsStudent
(
StaffMasqueradeTestCase
):
"""
"""
Check for staff being able to masquerade as student.
Check for staff being able to masquerade as student.
...
@@ -212,6 +215,7 @@ class TestStaffMasqueradeAsStudent(StaffMasqueradeTestCase):
...
@@ -212,6 +215,7 @@ class TestStaffMasqueradeAsStudent(StaffMasqueradeTestCase):
self
.
verify_show_answer_present
(
True
)
self
.
verify_show_answer_present
(
True
)
@attr
(
'shard_1'
)
class
TestGetMasqueradingGroupId
(
StaffMasqueradeTestCase
):
class
TestGetMasqueradingGroupId
(
StaffMasqueradeTestCase
):
"""
"""
Check for staff being able to masquerade as belonging to a group.
Check for staff being able to masquerade as belonging to a group.
...
...
lms/djangoapps/courseware/tests/test_microsites.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ Tests related to the Microsites feature
...
@@ -4,6 +4,7 @@ Tests related to the Microsites feature
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
nose.plugins.attrib
import
attr
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
course_modes.models
import
CourseMode
from
course_modes.models
import
CourseMode
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
@attr
(
'shard_1'
)
class
TestMicrosites
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestMicrosites
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
This is testing of the Microsite feature
This is testing of the Microsite feature
...
...
lms/djangoapps/courseware/tests/test_middleware.py
View file @
ddb1ae66
...
@@ -6,6 +6,7 @@ from django.core.urlresolvers import reverse
...
@@ -6,6 +6,7 @@ from django.core.urlresolvers import reverse
from
django.test.client
import
RequestFactory
from
django.test.client
import
RequestFactory
from
django.http
import
Http404
from
django.http
import
Http404
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
import
courseware.courses
as
courses
import
courseware.courses
as
courses
from
courseware.middleware
import
RedirectUnenrolledMiddleware
from
courseware.middleware
import
RedirectUnenrolledMiddleware
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
@attr
(
'shard_1'
)
class
CoursewareMiddlewareTestCase
(
ModuleStoreTestCase
):
class
CoursewareMiddlewareTestCase
(
ModuleStoreTestCase
):
"""Tests that courseware middleware is correctly redirected"""
"""Tests that courseware middleware is correctly redirected"""
...
...
lms/djangoapps/courseware/tests/test_model_data.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ Test for lms courseware app, module data (runtime data storage for XBlocks)
...
@@ -3,6 +3,7 @@ Test for lms courseware app, module data (runtime data storage for XBlocks)
"""
"""
import
json
import
json
from
mock
import
Mock
,
patch
from
mock
import
Mock
,
patch
from
nose.plugins.attrib
import
attr
from
functools
import
partial
from
functools
import
partial
from
courseware.model_data
import
DjangoKeyValueStore
from
courseware.model_data
import
DjangoKeyValueStore
...
@@ -52,6 +53,7 @@ class StudentModuleFactory(cmfStudentModuleFactory):
...
@@ -52,6 +53,7 @@ class StudentModuleFactory(cmfStudentModuleFactory):
course_id
=
course_id
course_id
=
course_id
@attr
(
'shard_1'
)
class
TestInvalidScopes
(
TestCase
):
class
TestInvalidScopes
(
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
super
(
TestInvalidScopes
,
self
)
.
setUp
()
super
(
TestInvalidScopes
,
self
)
.
setUp
()
...
@@ -72,6 +74,7 @@ class TestInvalidScopes(TestCase):
...
@@ -72,6 +74,7 @@ class TestInvalidScopes(TestCase):
self
.
assertRaises
(
InvalidScopeError
,
self
.
kvs
.
set_many
,
{
key
:
'value'
})
self
.
assertRaises
(
InvalidScopeError
,
self
.
kvs
.
set_many
,
{
key
:
'value'
})
@attr
(
'shard_1'
)
class
OtherUserFailureTestMixin
(
object
):
class
OtherUserFailureTestMixin
(
object
):
"""
"""
Mixin class to add test cases for failures when a user trying to use the kvs is not
Mixin class to add test cases for failures when a user trying to use the kvs is not
...
@@ -96,6 +99,7 @@ class OtherUserFailureTestMixin(object):
...
@@ -96,6 +99,7 @@ class OtherUserFailureTestMixin(object):
self
.
kvs
.
set
(
self
.
other_key_factory
(
self
.
existing_field_name
),
"new_value"
)
self
.
kvs
.
set
(
self
.
other_key_factory
(
self
.
existing_field_name
),
"new_value"
)
@attr
(
'shard_1'
)
class
TestStudentModuleStorage
(
OtherUserFailureTestMixin
,
TestCase
):
class
TestStudentModuleStorage
(
OtherUserFailureTestMixin
,
TestCase
):
"""Tests for user_state storage via StudentModule"""
"""Tests for user_state storage via StudentModule"""
other_key_factory
=
partial
(
DjangoKeyValueStore
.
Key
,
Scope
.
user_state
,
2
,
location
(
'usage_id'
))
# user_id=2, not 1
other_key_factory
=
partial
(
DjangoKeyValueStore
.
Key
,
Scope
.
user_state
,
2
,
location
(
'usage_id'
))
# user_id=2, not 1
...
@@ -206,6 +210,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase):
...
@@ -206,6 +210,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase):
self
.
assertEquals
(
len
(
exception_context
.
exception
.
saved_field_names
),
0
)
self
.
assertEquals
(
len
(
exception_context
.
exception
.
saved_field_names
),
0
)
@attr
(
'shard_1'
)
class
TestMissingStudentModule
(
TestCase
):
class
TestMissingStudentModule
(
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
super
(
TestMissingStudentModule
,
self
)
.
setUp
()
super
(
TestMissingStudentModule
,
self
)
.
setUp
()
...
@@ -253,6 +258,7 @@ class TestMissingStudentModule(TestCase):
...
@@ -253,6 +258,7 @@ class TestMissingStudentModule(TestCase):
self
.
assertFalse
(
self
.
kvs
.
has
(
user_state_key
(
'a_field'
)))
self
.
assertFalse
(
self
.
kvs
.
has
(
user_state_key
(
'a_field'
)))
@attr
(
'shard_1'
)
class
StorageTestBase
(
object
):
class
StorageTestBase
(
object
):
"""
"""
A base class for that gets subclassed when testing each of the scopes.
A base class for that gets subclassed when testing each of the scopes.
...
...
lms/djangoapps/courseware/tests/test_module_render.py
View file @
ddb1ae66
...
@@ -5,6 +5,7 @@ Test for lms courseware app, module render unit
...
@@ -5,6 +5,7 @@ Test for lms courseware app, module render unit
import
ddt
import
ddt
import
itertools
import
itertools
import
json
import
json
from
nose.plugins.attrib
import
attr
from
functools
import
partial
from
functools
import
partial
from
bson
import
ObjectId
from
bson
import
ObjectId
...
@@ -74,6 +75,7 @@ class EmptyXModuleDescriptor(XModuleDescriptor): # pylint: disable=abstract-met
...
@@ -74,6 +75,7 @@ class EmptyXModuleDescriptor(XModuleDescriptor): # pylint: disable=abstract-met
module_class
=
EmptyXModule
module_class
=
EmptyXModule
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
ModuleRenderTestCase
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
ModuleRenderTestCase
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
...
@@ -258,6 +260,7 @@ class ModuleRenderTestCase(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -258,6 +260,7 @@ class ModuleRenderTestCase(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertEqual
(
hash_resource
(
resources
),
'a76e27c8e80ca3efd7ce743093aa59e0'
)
self
.
assertEqual
(
hash_resource
(
resources
),
'a76e27c8e80ca3efd7ce743093aa59e0'
)
@attr
(
'shard_1'
)
class
TestHandleXBlockCallback
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestHandleXBlockCallback
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
Test the handle_xblock_callback function
Test the handle_xblock_callback function
...
@@ -435,6 +438,7 @@ class TestHandleXBlockCallback(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -435,6 +438,7 @@ class TestHandleXBlockCallback(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertEquals
(
len
(
doc
(
'div.xblock-student_view-videosequence'
)),
1
)
self
.
assertEquals
(
len
(
doc
(
'div.xblock-student_view-videosequence'
)),
1
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
TestTOC
(
ModuleStoreTestCase
):
class
TestTOC
(
ModuleStoreTestCase
):
"""Check the Table of Contents for a course"""
"""Check the Table of Contents for a course"""
...
@@ -531,6 +535,7 @@ class TestTOC(ModuleStoreTestCase):
...
@@ -531,6 +535,7 @@ class TestTOC(ModuleStoreTestCase):
self
.
assertIn
(
toc_section
,
actual
)
self
.
assertIn
(
toc_section
,
actual
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
TestHtmlModifiers
(
ModuleStoreTestCase
):
class
TestHtmlModifiers
(
ModuleStoreTestCase
):
"""
"""
...
@@ -692,6 +697,7 @@ class XBlockWithJsonInitData(XBlock):
...
@@ -692,6 +697,7 @@ class XBlockWithJsonInitData(XBlock):
return
frag
return
frag
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
JsonInitDataTest
(
ModuleStoreTestCase
):
class
JsonInitDataTest
(
ModuleStoreTestCase
):
"""Tests for JSON data injected into the JS init function."""
"""Tests for JSON data injected into the JS init function."""
...
@@ -785,6 +791,7 @@ class ViewInStudioTest(ModuleStoreTestCase):
...
@@ -785,6 +791,7 @@ class ViewInStudioTest(ModuleStoreTestCase):
self
.
module
=
self
.
_get_module
(
course_key
,
descriptor
,
location
)
self
.
module
=
self
.
_get_module
(
course_key
,
descriptor
,
location
)
@attr
(
'shard_1'
)
class
MongoViewInStudioTest
(
ViewInStudioTest
):
class
MongoViewInStudioTest
(
ViewInStudioTest
):
"""Test the 'View in Studio' link visibility in a mongo backed course."""
"""Test the 'View in Studio' link visibility in a mongo backed course."""
...
@@ -813,6 +820,7 @@ class MongoViewInStudioTest(ViewInStudioTest):
...
@@ -813,6 +820,7 @@ class MongoViewInStudioTest(ViewInStudioTest):
self
.
assertNotIn
(
'View Unit in Studio'
,
result_fragment
.
content
)
self
.
assertNotIn
(
'View Unit in Studio'
,
result_fragment
.
content
)
@attr
(
'shard_1'
)
class
MixedViewInStudioTest
(
ViewInStudioTest
):
class
MixedViewInStudioTest
(
ViewInStudioTest
):
"""Test the 'View in Studio' link visibility in a mixed mongo backed course."""
"""Test the 'View in Studio' link visibility in a mixed mongo backed course."""
...
@@ -837,6 +845,7 @@ class MixedViewInStudioTest(ViewInStudioTest):
...
@@ -837,6 +845,7 @@ class MixedViewInStudioTest(ViewInStudioTest):
self
.
assertNotIn
(
'View Unit in Studio'
,
result_fragment
.
content
)
self
.
assertNotIn
(
'View Unit in Studio'
,
result_fragment
.
content
)
@attr
(
'shard_1'
)
class
XmlViewInStudioTest
(
ViewInStudioTest
):
class
XmlViewInStudioTest
(
ViewInStudioTest
):
"""Test the 'View in Studio' link visibility in an xml backed course."""
"""Test the 'View in Studio' link visibility in an xml backed course."""
MODULESTORE
=
TEST_DATA_XML_MODULESTORE
MODULESTORE
=
TEST_DATA_XML_MODULESTORE
...
@@ -848,6 +857,7 @@ class XmlViewInStudioTest(ViewInStudioTest):
...
@@ -848,6 +857,7 @@ class XmlViewInStudioTest(ViewInStudioTest):
self
.
assertNotIn
(
'View Unit in Studio'
,
result_fragment
.
content
)
self
.
assertNotIn
(
'View Unit in Studio'
,
result_fragment
.
content
)
@attr
(
'shard_1'
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISPLAY_DEBUG_INFO_TO_STAFF'
:
True
,
'DISPLAY_HISTOGRAMS_TO_STAFF'
:
True
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISPLAY_DEBUG_INFO_TO_STAFF'
:
True
,
'DISPLAY_HISTOGRAMS_TO_STAFF'
:
True
})
@patch
(
'courseware.module_render.has_access'
,
Mock
(
return_value
=
True
))
@patch
(
'courseware.module_render.has_access'
,
Mock
(
return_value
=
True
))
class
TestStaffDebugInfo
(
ModuleStoreTestCase
):
class
TestStaffDebugInfo
(
ModuleStoreTestCase
):
...
@@ -968,6 +978,7 @@ PER_STUDENT_ANONYMIZED_DESCRIPTORS = set(
...
@@ -968,6 +978,7 @@ PER_STUDENT_ANONYMIZED_DESCRIPTORS = set(
)
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
TestAnonymousStudentId
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestAnonymousStudentId
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
...
@@ -1043,6 +1054,7 @@ class TestAnonymousStudentId(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -1043,6 +1054,7 @@ class TestAnonymousStudentId(ModuleStoreTestCase, LoginEnrollmentTestCase):
)
)
@attr
(
'shard_1'
)
@patch
(
'track.views.tracker'
)
@patch
(
'track.views.tracker'
)
class
TestModuleTrackingContext
(
ModuleStoreTestCase
):
class
TestModuleTrackingContext
(
ModuleStoreTestCase
):
"""
"""
...
@@ -1121,6 +1133,7 @@ class TestModuleTrackingContext(ModuleStoreTestCase):
...
@@ -1121,6 +1133,7 @@ class TestModuleTrackingContext(ModuleStoreTestCase):
self
.
assertEqual
(
module_info
[
'original_usage_version'
],
unicode
(
original_usage_version
))
self
.
assertEqual
(
module_info
[
'original_usage_version'
],
unicode
(
original_usage_version
))
@attr
(
'shard_1'
)
class
TestXmoduleRuntimeEvent
(
TestSubmittingProblems
):
class
TestXmoduleRuntimeEvent
(
TestSubmittingProblems
):
"""
"""
Inherit from TestSubmittingProblems to get functionality that set up a course and problems structure
Inherit from TestSubmittingProblems to get functionality that set up a course and problems structure
...
@@ -1169,6 +1182,7 @@ class TestXmoduleRuntimeEvent(TestSubmittingProblems):
...
@@ -1169,6 +1182,7 @@ class TestXmoduleRuntimeEvent(TestSubmittingProblems):
self
.
assertIsNone
(
student_module
.
max_grade
)
self
.
assertIsNone
(
student_module
.
max_grade
)
@attr
(
'shard_1'
)
class
TestRebindModule
(
TestSubmittingProblems
):
class
TestRebindModule
(
TestSubmittingProblems
):
"""
"""
Tests to verify the functionality of rebinding a module.
Tests to verify the functionality of rebinding a module.
...
@@ -1235,6 +1249,7 @@ class TestRebindModule(TestSubmittingProblems):
...
@@ -1235,6 +1249,7 @@ class TestRebindModule(TestSubmittingProblems):
self
.
assertFalse
(
psycho_handler
.
called
)
self
.
assertFalse
(
psycho_handler
.
called
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
TestEventPublishing
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestEventPublishing
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
...
@@ -1273,6 +1288,7 @@ class TestEventPublishing(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -1273,6 +1288,7 @@ class TestEventPublishing(ModuleStoreTestCase, LoginEnrollmentTestCase):
mock_track_function
.
return_value
.
assert_called_once_with
(
event_type
,
event
)
mock_track_function
.
return_value
.
assert_called_once_with
(
event_type
,
event
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
LMSXBlockServiceBindingTest
(
ModuleStoreTestCase
):
class
LMSXBlockServiceBindingTest
(
ModuleStoreTestCase
):
"""
"""
...
@@ -1355,6 +1371,7 @@ BLOCK_TYPES = ['xblock', 'xmodule']
...
@@ -1355,6 +1371,7 @@ BLOCK_TYPES = ['xblock', 'xmodule']
USER_NUMBERS
=
range
(
2
)
USER_NUMBERS
=
range
(
2
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
TestFilteredChildren
(
ModuleStoreTestCase
):
class
TestFilteredChildren
(
ModuleStoreTestCase
):
"""
"""
...
...
lms/djangoapps/courseware/tests/test_navigation.py
View file @
ddb1ae66
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
This test file will run through some LMS test scenarios regarding access and navigation of the LMS
This test file will run through some LMS test scenarios regarding access and navigation of the LMS
"""
"""
import
time
import
time
from
nose.plugins.attrib
import
attr
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
@attr
(
'shard_1'
)
class
TestNavigation
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestNavigation
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
Check that navigation state is saved properly.
Check that navigation state is saved properly.
...
...
lms/djangoapps/courseware/tests/test_password_history.py
View file @
ddb1ae66
...
@@ -4,6 +4,7 @@ This file will test through the LMS some of the PasswordHistory features
...
@@ -4,6 +4,7 @@ This file will test through the LMS some of the PasswordHistory features
import
json
import
json
from
mock
import
patch
from
mock
import
patch
from
uuid
import
uuid4
from
uuid
import
uuid4
from
nose.plugins.attrib
import
attr
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.utils
import
timezone
from
django.utils
import
timezone
...
@@ -20,6 +21,7 @@ from student.models import PasswordHistory
...
@@ -20,6 +21,7 @@ from student.models import PasswordHistory
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
@attr
(
'shard_1'
)
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ADVANCED_SECURITY'
:
True
})
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ADVANCED_SECURITY'
:
True
})
class
TestPasswordHistory
(
LoginEnrollmentTestCase
):
class
TestPasswordHistory
(
LoginEnrollmentTestCase
):
"""
"""
...
...
lms/djangoapps/courseware/tests/test_recommender.py
View file @
ddb1ae66
...
@@ -7,6 +7,7 @@ import itertools
...
@@ -7,6 +7,7 @@ import itertools
import
StringIO
import
StringIO
from
ddt
import
ddt
,
data
from
ddt
import
ddt
,
data
from
copy
import
deepcopy
from
copy
import
deepcopy
from
nose.plugins.attrib
import
attr
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -183,6 +184,7 @@ class TestRecommender(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -183,6 +184,7 @@ class TestRecommender(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assert_request_status_code
(
200
,
self
.
course_url
)
self
.
assert_request_status_code
(
200
,
self
.
course_url
)
@attr
(
'shard_1'
)
class
TestRecommenderCreateFromEmpty
(
TestRecommender
):
class
TestRecommenderCreateFromEmpty
(
TestRecommender
):
"""
"""
Check whether we can add resources to an empty database correctly
Check whether we can add resources to an empty database correctly
...
@@ -209,6 +211,7 @@ class TestRecommenderCreateFromEmpty(TestRecommender):
...
@@ -209,6 +211,7 @@ class TestRecommenderCreateFromEmpty(TestRecommender):
self
.
assert_request_status_code
(
200
,
self
.
course_url
)
self
.
assert_request_status_code
(
200
,
self
.
course_url
)
@attr
(
'shard_1'
)
class
TestRecommenderWithResources
(
TestRecommender
):
class
TestRecommenderWithResources
(
TestRecommender
):
"""
"""
Check whether we can add/edit/flag/export resources correctly
Check whether we can add/edit/flag/export resources correctly
...
@@ -403,6 +406,7 @@ class TestRecommenderWithResources(TestRecommender):
...
@@ -403,6 +406,7 @@ class TestRecommenderWithResources(TestRecommender):
self
.
assert_request_status_code
(
200
,
self
.
course_url
)
self
.
assert_request_status_code
(
200
,
self
.
course_url
)
@attr
(
'shard_1'
)
@ddt
@ddt
class
TestRecommenderVoteWithResources
(
TestRecommenderWithResources
):
class
TestRecommenderVoteWithResources
(
TestRecommenderWithResources
):
"""
"""
...
@@ -520,6 +524,7 @@ class TestRecommenderVoteWithResources(TestRecommenderWithResources):
...
@@ -520,6 +524,7 @@ class TestRecommenderVoteWithResources(TestRecommenderWithResources):
self
.
check_event_response_by_key
(
'handle_vote'
,
resource
,
'newVotes'
,
test_case
[
'new_votes'
])
self
.
check_event_response_by_key
(
'handle_vote'
,
resource
,
'newVotes'
,
test_case
[
'new_votes'
])
@attr
(
'shard_1'
)
@ddt
@ddt
class
TestRecommenderStaffFeedbackWithResources
(
TestRecommenderWithResources
):
class
TestRecommenderStaffFeedbackWithResources
(
TestRecommenderWithResources
):
"""
"""
...
@@ -618,6 +623,7 @@ class TestRecommenderStaffFeedbackWithResources(TestRecommenderWithResources):
...
@@ -618,6 +623,7 @@ class TestRecommenderStaffFeedbackWithResources(TestRecommenderWithResources):
self
.
check_event_response_by_http_status
(
test_case
[
'handler'
],
resource
,
test_case
[
'status'
])
self
.
check_event_response_by_http_status
(
test_case
[
'handler'
],
resource
,
test_case
[
'status'
])
@attr
(
'shard_1'
)
@ddt
@ddt
class
TestRecommenderFileUploading
(
TestRecommender
):
class
TestRecommenderFileUploading
(
TestRecommender
):
"""
"""
...
...
lms/djangoapps/courseware/tests/test_split_module.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ Test for split test XModule
...
@@ -3,6 +3,7 @@ Test for split test XModule
"""
"""
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
mock
import
MagicMock
from
mock
import
MagicMock
from
nose.plugins.attrib
import
attr
from
courseware.module_render
import
get_module_for_descriptor
from
courseware.module_render
import
get_module_for_descriptor
from
courseware.model_data
import
FieldDataCache
from
courseware.model_data
import
FieldDataCache
...
@@ -13,6 +14,7 @@ from xmodule.partitions.partitions import Group, UserPartition
...
@@ -13,6 +14,7 @@ from xmodule.partitions.partitions import Group, UserPartition
from
openedx.core.djangoapps.user_api.tests.factories
import
UserCourseTagFactory
from
openedx.core.djangoapps.user_api.tests.factories
import
UserCourseTagFactory
@attr
(
'shard_1'
)
class
SplitTestBase
(
ModuleStoreTestCase
):
class
SplitTestBase
(
ModuleStoreTestCase
):
"""
"""
Sets up a basic course and user for split test testing.
Sets up a basic course and user for split test testing.
...
@@ -268,6 +270,7 @@ class TestSplitTestVert(SplitTestBase):
...
@@ -268,6 +270,7 @@ class TestSplitTestVert(SplitTestBase):
html1
=
self
.
_html
(
cond1vert
,
1
)
html1
=
self
.
_html
(
cond1vert
,
1
)
@attr
(
'shard_1'
)
class
SplitTestPosition
(
ModuleStoreTestCase
):
class
SplitTestPosition
(
ModuleStoreTestCase
):
"""
"""
Check that we can change positions in a course with partitions defined
Check that we can change positions in a course with partitions defined
...
...
lms/djangoapps/courseware/tests/test_submitting_problems.py
View file @
ddb1ae66
...
@@ -11,6 +11,7 @@ from django.contrib.auth.models import User
...
@@ -11,6 +11,7 @@ from django.contrib.auth.models import User
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test.client
import
RequestFactory
from
django.test.client
import
RequestFactory
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
capa.tests.response_xml_factory
import
(
from
capa.tests.response_xml_factory
import
(
OptionResponseXMLFactory
,
CustomResponseXMLFactory
,
SchematicResponseXMLFactory
,
OptionResponseXMLFactory
,
CustomResponseXMLFactory
,
SchematicResponseXMLFactory
,
...
@@ -293,6 +294,7 @@ class TestSubmittingProblems(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -293,6 +294,7 @@ class TestSubmittingProblems(ModuleStoreTestCase, LoginEnrollmentTestCase):
return
[
s
.
earned
for
s
in
hw_section
[
'scores'
]]
return
[
s
.
earned
for
s
in
hw_section
[
'scores'
]]
@attr
(
'shard_1'
)
class
TestCourseGrader
(
TestSubmittingProblems
):
class
TestCourseGrader
(
TestSubmittingProblems
):
"""
"""
Suite of tests for the course grader.
Suite of tests for the course grader.
...
@@ -593,6 +595,7 @@ class TestCourseGrader(TestSubmittingProblems):
...
@@ -593,6 +595,7 @@ class TestCourseGrader(TestSubmittingProblems):
self
.
assertEqual
(
self
.
score_for_hw
(
'homework3'
),
[
1.0
,
1.0
])
self
.
assertEqual
(
self
.
score_for_hw
(
'homework3'
),
[
1.0
,
1.0
])
@attr
(
'shard_1'
)
class
ProblemWithUploadedFilesTest
(
TestSubmittingProblems
):
class
ProblemWithUploadedFilesTest
(
TestSubmittingProblems
):
"""Tests of problems with uploaded files."""
"""Tests of problems with uploaded files."""
...
@@ -645,6 +648,7 @@ class ProblemWithUploadedFilesTest(TestSubmittingProblems):
...
@@ -645,6 +648,7 @@ class ProblemWithUploadedFilesTest(TestSubmittingProblems):
self
.
assertItemsEqual
(
kwargs
[
'files'
]
.
keys
(),
filenames
.
split
())
self
.
assertItemsEqual
(
kwargs
[
'files'
]
.
keys
(),
filenames
.
split
())
@attr
(
'shard_1'
)
class
TestPythonGradedResponse
(
TestSubmittingProblems
):
class
TestPythonGradedResponse
(
TestSubmittingProblems
):
"""
"""
Check that we can submit a schematic and custom response, and it answers properly.
Check that we can submit a schematic and custom response, and it answers properly.
...
@@ -893,6 +897,7 @@ class TestPythonGradedResponse(TestSubmittingProblems):
...
@@ -893,6 +897,7 @@ class TestPythonGradedResponse(TestSubmittingProblems):
self
.
_check_ireset
(
name
)
self
.
_check_ireset
(
name
)
@attr
(
'shard_1'
)
class
TestAnswerDistributions
(
TestSubmittingProblems
):
class
TestAnswerDistributions
(
TestSubmittingProblems
):
"""Check that we can pull answer distributions for problems."""
"""Check that we can pull answer distributions for problems."""
...
@@ -1048,6 +1053,7 @@ class TestAnswerDistributions(TestSubmittingProblems):
...
@@ -1048,6 +1053,7 @@ class TestAnswerDistributions(TestSubmittingProblems):
)
)
@attr
(
'shard_1'
)
class
TestConditionalContent
(
TestSubmittingProblems
):
class
TestConditionalContent
(
TestSubmittingProblems
):
"""
"""
Check that conditional content works correctly with grading.
Check that conditional content works correctly with grading.
...
...
lms/djangoapps/courseware/tests/test_tabs.py
View file @
ddb1ae66
...
@@ -6,6 +6,7 @@ from django.conf import settings
...
@@ -6,6 +6,7 @@ from django.conf import settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.http
import
Http404
from
django.http
import
Http404
from
mock
import
MagicMock
,
Mock
,
patch
from
mock
import
MagicMock
,
Mock
,
patch
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
courseware.courses
import
get_course_by_id
from
courseware.courses
import
get_course_by_id
...
@@ -24,6 +25,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...
@@ -24,6 +25,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
@attr
(
'shard_1'
)
class
StaticTabDateTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
StaticTabDateTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""Test cases for Static Tab Dates."""
"""Test cases for Static Tab Dates."""
...
@@ -75,6 +77,7 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -75,6 +77,7 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertIn
(
"this module is temporarily unavailable"
,
static_tab
)
self
.
assertIn
(
"this module is temporarily unavailable"
,
static_tab
)
@attr
(
'shard_1'
)
class
StaticTabDateTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
StaticTabDateTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Tests for the static tab dates of an XML course
Tests for the static tab dates of an XML course
...
@@ -108,6 +111,7 @@ class StaticTabDateTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -108,6 +111,7 @@ class StaticTabDateTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertIn
(
self
.
xml_data
,
resp
.
content
)
self
.
assertIn
(
self
.
xml_data
,
resp
.
content
)
@attr
(
'shard_1'
)
class
EntranceExamsTabsTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
EntranceExamsTabsTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Validate tab behavior when dealing with Entrance Exams
Validate tab behavior when dealing with Entrance Exams
...
@@ -214,6 +218,7 @@ class EntranceExamsTabsTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -214,6 +218,7 @@ class EntranceExamsTabsTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertEqual
(
len
(
course_tab_list
),
5
)
self
.
assertEqual
(
len
(
course_tab_list
),
5
)
@attr
(
'shard_1'
)
class
TextBookTabsTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
TextBookTabsTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Validate tab behavior when dealing with textbooks.
Validate tab behavior when dealing with textbooks.
...
...
lms/djangoapps/courseware/tests/test_video_handlers.py
View file @
ddb1ae66
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
"""Video xmodule tests in mongo."""
"""Video xmodule tests in mongo."""
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
import
os
import
os
import
tempfile
import
tempfile
import
textwrap
import
textwrap
...
@@ -103,6 +104,7 @@ def _upload_file(subs_file, location, filename):
...
@@ -103,6 +104,7 @@ def _upload_file(subs_file, location, filename):
del_cached_content
(
content
.
location
)
del_cached_content
(
content
.
location
)
@attr
(
'shard_1'
)
class
TestVideo
(
BaseTestXmodule
):
class
TestVideo
(
BaseTestXmodule
):
"""Integration tests: web client + mongo."""
"""Integration tests: web client + mongo."""
CATEGORY
=
"video"
CATEGORY
=
"video"
...
@@ -157,6 +159,7 @@ class TestVideo(BaseTestXmodule):
...
@@ -157,6 +159,7 @@ class TestVideo(BaseTestXmodule):
super
(
TestVideo
,
self
)
.
tearDown
()
super
(
TestVideo
,
self
)
.
tearDown
()
@attr
(
'shard_1'
)
class
TestTranscriptAvailableTranslationsDispatch
(
TestVideo
):
class
TestTranscriptAvailableTranslationsDispatch
(
TestVideo
):
"""
"""
Test video handler that provide available translations info.
Test video handler that provide available translations info.
...
@@ -216,6 +219,7 @@ class TestTranscriptAvailableTranslationsDispatch(TestVideo):
...
@@ -216,6 +219,7 @@ class TestTranscriptAvailableTranslationsDispatch(TestVideo):
self
.
assertEqual
(
json
.
loads
(
response
.
body
),
[
'en'
,
'uk'
])
self
.
assertEqual
(
json
.
loads
(
response
.
body
),
[
'en'
,
'uk'
])
@attr
(
'shard_1'
)
class
TestTranscriptDownloadDispatch
(
TestVideo
):
class
TestTranscriptDownloadDispatch
(
TestVideo
):
"""
"""
Test video handler that provide translation transcripts.
Test video handler that provide translation transcripts.
...
@@ -280,6 +284,7 @@ class TestTranscriptDownloadDispatch(TestVideo):
...
@@ -280,6 +284,7 @@ class TestTranscriptDownloadDispatch(TestVideo):
self
.
assertEqual
(
response
.
headers
[
'Content-Disposition'
],
'attachment; filename="塞.srt"'
)
self
.
assertEqual
(
response
.
headers
[
'Content-Disposition'
],
'attachment; filename="塞.srt"'
)
@attr
(
'shard_1'
)
class
TestTranscriptTranslationGetDispatch
(
TestVideo
):
class
TestTranscriptTranslationGetDispatch
(
TestVideo
):
"""
"""
Test video handler that provide translation transcripts.
Test video handler that provide translation transcripts.
...
@@ -485,6 +490,7 @@ class TestTranscriptTranslationGetDispatch(TestVideo):
...
@@ -485,6 +490,7 @@ class TestTranscriptTranslationGetDispatch(TestVideo):
self
.
assertEqual
(
response
.
status
,
'404 Not Found'
)
self
.
assertEqual
(
response
.
status
,
'404 Not Found'
)
@attr
(
'shard_1'
)
class
TestStudioTranscriptTranslationGetDispatch
(
TestVideo
):
class
TestStudioTranscriptTranslationGetDispatch
(
TestVideo
):
"""
"""
Test Studio video handler that provide translation transcripts.
Test Studio video handler that provide translation transcripts.
...
@@ -542,6 +548,7 @@ class TestStudioTranscriptTranslationGetDispatch(TestVideo):
...
@@ -542,6 +548,7 @@ class TestStudioTranscriptTranslationGetDispatch(TestVideo):
self
.
assertEqual
(
response
.
headers
[
'Content-Language'
],
'zh'
)
self
.
assertEqual
(
response
.
headers
[
'Content-Language'
],
'zh'
)
@attr
(
'shard_1'
)
class
TestStudioTranscriptTranslationPostDispatch
(
TestVideo
):
class
TestStudioTranscriptTranslationPostDispatch
(
TestVideo
):
"""
"""
Test Studio video handler that provide translation transcripts.
Test Studio video handler that provide translation transcripts.
...
@@ -602,6 +609,7 @@ class TestStudioTranscriptTranslationPostDispatch(TestVideo):
...
@@ -602,6 +609,7 @@ class TestStudioTranscriptTranslationPostDispatch(TestVideo):
self
.
assertTrue
(
_check_asset
(
self
.
item_descriptor
.
location
,
u'filename.srt'
))
self
.
assertTrue
(
_check_asset
(
self
.
item_descriptor
.
location
,
u'filename.srt'
))
@attr
(
'shard_1'
)
class
TestGetTranscript
(
TestVideo
):
class
TestGetTranscript
(
TestVideo
):
"""
"""
Make sure that `get_transcript` method works correctly
Make sure that `get_transcript` method works correctly
...
...
lms/djangoapps/courseware/tests/test_video_mongo.py
View file @
ddb1ae66
...
@@ -5,6 +5,7 @@ from collections import OrderedDict
...
@@ -5,6 +5,7 @@ from collections import OrderedDict
from
lxml
import
etree
from
lxml
import
etree
from
mock
import
patch
,
MagicMock
,
Mock
from
mock
import
patch
,
MagicMock
,
Mock
from
nose.plugins.attrib
import
attr
from
django.conf
import
settings
from
django.conf
import
settings
from
django.test
import
TestCase
from
django.test
import
TestCase
...
@@ -23,6 +24,7 @@ from .test_video_xml import SOURCE_XML
...
@@ -23,6 +24,7 @@ from .test_video_xml import SOURCE_XML
from
.test_video_handlers
import
TestVideo
from
.test_video_handlers
import
TestVideo
@attr
(
'shard_1'
)
class
TestVideoYouTube
(
TestVideo
):
class
TestVideoYouTube
(
TestVideo
):
METADATA
=
{}
METADATA
=
{}
...
@@ -73,6 +75,7 @@ class TestVideoYouTube(TestVideo):
...
@@ -73,6 +75,7 @@ class TestVideoYouTube(TestVideo):
)
)
@attr
(
'shard_1'
)
class
TestVideoNonYouTube
(
TestVideo
):
class
TestVideoNonYouTube
(
TestVideo
):
"""Integration tests: web client + mongo."""
"""Integration tests: web client + mongo."""
DATA
=
"""
DATA
=
"""
...
@@ -140,6 +143,7 @@ class TestVideoNonYouTube(TestVideo):
...
@@ -140,6 +143,7 @@ class TestVideoNonYouTube(TestVideo):
)
)
@attr
(
'shard_1'
)
class
TestGetHtmlMethod
(
BaseTestXmodule
):
class
TestGetHtmlMethod
(
BaseTestXmodule
):
'''
'''
Make sure that `get_html` works correctly.
Make sure that `get_html` works correctly.
...
@@ -759,6 +763,7 @@ class TestGetHtmlMethod(BaseTestXmodule):
...
@@ -759,6 +763,7 @@ class TestGetHtmlMethod(BaseTestXmodule):
)
)
@attr
(
'shard_1'
)
class
TestVideoDescriptorInitialization
(
BaseTestXmodule
):
class
TestVideoDescriptorInitialization
(
BaseTestXmodule
):
"""
"""
Make sure that module initialization works correctly.
Make sure that module initialization works correctly.
...
@@ -829,6 +834,7 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
...
@@ -829,6 +834,7 @@ class TestVideoDescriptorInitialization(BaseTestXmodule):
self
.
assertFalse
(
self
.
item_descriptor
.
download_video
)
self
.
assertFalse
(
self
.
item_descriptor
.
download_video
)
@attr
(
'shard_1'
)
class
VideoDescriptorTest
(
TestCase
,
VideoDescriptorTestBase
):
class
VideoDescriptorTest
(
TestCase
,
VideoDescriptorTestBase
):
"""
"""
Tests for video descriptor that requires access to django settings.
Tests for video descriptor that requires access to django settings.
...
...
lms/djangoapps/courseware/tests/test_video_xml.py
View file @
ddb1ae66
...
@@ -14,6 +14,7 @@ You can then use the CourseFactory and XModuleItemFactory as defined in
...
@@ -14,6 +14,7 @@ You can then use the CourseFactory and XModuleItemFactory as defined in
common/lib/xmodule/xmodule/modulestore/tests/factories.py to create the
common/lib/xmodule/xmodule/modulestore/tests/factories.py to create the
course, section, subsection, unit, etc.
course, section, subsection, unit, etc.
"""
"""
from
nose.plugins.attrib
import
attr
from
xmodule.video_module
import
VideoDescriptor
from
xmodule.video_module
import
VideoDescriptor
from
xmodule.tests
import
LogicTest
from
xmodule.tests
import
LogicTest
...
@@ -34,6 +35,7 @@ SOURCE_XML = """
...
@@ -34,6 +35,7 @@ SOURCE_XML = """
"""
"""
@attr
(
'shard_1'
)
class
VideoModuleLogicTest
(
LogicTest
):
class
VideoModuleLogicTest
(
LogicTest
):
"""Tests for logic of Video Xmodule."""
"""Tests for logic of Video Xmodule."""
...
...
lms/djangoapps/courseware/tests/test_view_authentication.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ import pytz
...
@@ -3,6 +3,7 @@ import pytz
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
courseware.access
import
has_access
from
courseware.access
import
has_access
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
...
@@ -20,6 +21,7 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
...
@@ -20,6 +21,7 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
@attr
(
'shard_1'
)
class
TestViewAuth
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestViewAuth
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
Check that view authentication works properly.
Check that view authentication works properly.
...
@@ -386,6 +388,7 @@ class TestViewAuth(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -386,6 +388,7 @@ class TestViewAuth(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertTrue
(
self
.
enroll
(
self
.
course
))
self
.
assertTrue
(
self
.
enroll
(
self
.
course
))
@attr
(
'shard_1'
)
class
TestBetatesterAccess
(
ModuleStoreTestCase
):
class
TestBetatesterAccess
(
ModuleStoreTestCase
):
"""
"""
Tests for the beta tester feature
Tests for the beta tester feature
...
...
lms/djangoapps/courseware/tests/test_views.py
View file @
ddb1ae66
...
@@ -7,6 +7,7 @@ import ddt
...
@@ -7,6 +7,7 @@ import ddt
import
json
import
json
import
unittest
import
unittest
from
datetime
import
datetime
from
datetime
import
datetime
from
nose.plugins.attrib
import
attr
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.auth.models
import
AnonymousUser
from
django.contrib.auth.models
import
AnonymousUser
...
@@ -42,6 +43,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...
@@ -42,6 +43,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
@attr
(
'shard_1'
)
class
TestJumpTo
(
ModuleStoreTestCase
):
class
TestJumpTo
(
ModuleStoreTestCase
):
"""
"""
Check the jumpto link for a course.
Check the jumpto link for a course.
...
@@ -162,6 +164,7 @@ class TestJumpTo(ModuleStoreTestCase):
...
@@ -162,6 +164,7 @@ class TestJumpTo(ModuleStoreTestCase):
self
.
assertEqual
(
response
.
status_code
,
404
)
self
.
assertEqual
(
response
.
status_code
,
404
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
ViewsTestCase
(
ModuleStoreTestCase
):
class
ViewsTestCase
(
ModuleStoreTestCase
):
"""
"""
...
@@ -555,6 +558,7 @@ class ViewsTestCase(ModuleStoreTestCase):
...
@@ -555,6 +558,7 @@ class ViewsTestCase(ModuleStoreTestCase):
self
.
assertNotContains
(
response
,
checkbox_html
,
html
=
True
)
self
.
assertNotContains
(
response
,
checkbox_html
,
html
=
True
)
@attr
(
'shard_1'
)
# setting TIME_ZONE_DISPLAYED_FOR_DEADLINES explicitly
# setting TIME_ZONE_DISPLAYED_FOR_DEADLINES explicitly
@override_settings
(
TIME_ZONE_DISPLAYED_FOR_DEADLINES
=
"UTC"
)
@override_settings
(
TIME_ZONE_DISPLAYED_FOR_DEADLINES
=
"UTC"
)
class
BaseDueDateTests
(
ModuleStoreTestCase
):
class
BaseDueDateTests
(
ModuleStoreTestCase
):
...
@@ -672,6 +676,7 @@ class TestAccordionDueDate(BaseDueDateTests):
...
@@ -672,6 +676,7 @@ class TestAccordionDueDate(BaseDueDateTests):
)
)
@attr
(
'shard_1'
)
class
StartDateTests
(
ModuleStoreTestCase
):
class
StartDateTests
(
ModuleStoreTestCase
):
"""
"""
Test that start dates are properly localized and displayed on the student
Test that start dates are properly localized and displayed on the student
...
@@ -727,6 +732,7 @@ class StartDateTests(ModuleStoreTestCase):
...
@@ -727,6 +732,7 @@ class StartDateTests(ModuleStoreTestCase):
self
.
assertIn
(
"2015-JULY-17"
,
text
)
self
.
assertIn
(
"2015-JULY-17"
,
text
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
ProgressPageTests
(
ModuleStoreTestCase
):
class
ProgressPageTests
(
ModuleStoreTestCase
):
"""
"""
...
@@ -808,6 +814,7 @@ class ProgressPageTests(ModuleStoreTestCase):
...
@@ -808,6 +814,7 @@ class ProgressPageTests(ModuleStoreTestCase):
self
.
assertNotContains
(
resp
,
'Request Certificate'
)
self
.
assertNotContains
(
resp
,
'Request Certificate'
)
@attr
(
'shard_1'
)
class
VerifyCourseKeyDecoratorTests
(
TestCase
):
class
VerifyCourseKeyDecoratorTests
(
TestCase
):
"""
"""
Tests for the ensure_valid_course_key decorator.
Tests for the ensure_valid_course_key decorator.
...
@@ -833,6 +840,7 @@ class VerifyCourseKeyDecoratorTests(TestCase):
...
@@ -833,6 +840,7 @@ class VerifyCourseKeyDecoratorTests(TestCase):
self
.
assertFalse
(
mocked_view
.
called
)
self
.
assertFalse
(
mocked_view
.
called
)
@attr
(
'shard_1'
)
class
IsCoursePassedTests
(
ModuleStoreTestCase
):
class
IsCoursePassedTests
(
ModuleStoreTestCase
):
"""
"""
Tests for the is_course_passed helper function
Tests for the is_course_passed helper function
...
@@ -867,6 +875,7 @@ class IsCoursePassedTests(ModuleStoreTestCase):
...
@@ -867,6 +875,7 @@ class IsCoursePassedTests(ModuleStoreTestCase):
self
.
assertFalse
(
views
.
is_course_passed
(
self
.
course
,
None
,
self
.
student
,
self
.
request
))
self
.
assertFalse
(
views
.
is_course_passed
(
self
.
course
,
None
,
self
.
student
,
self
.
request
))
@attr
(
'shard_1'
)
class
GenerateUserCertTests
(
ModuleStoreTestCase
):
class
GenerateUserCertTests
(
ModuleStoreTestCase
):
"""
"""
Tests for the view function Generated User Certs
Tests for the view function Generated User Certs
...
@@ -1022,6 +1031,7 @@ class ViewCheckerBlock(XBlock):
...
@@ -1022,6 +1031,7 @@ class ViewCheckerBlock(XBlock):
return
result
return
result
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
TestIndexView
(
ModuleStoreTestCase
):
class
TestIndexView
(
ModuleStoreTestCase
):
"""
"""
...
...
lms/djangoapps/courseware/tests/test_word_cloud.py
View file @
ddb1ae66
...
@@ -3,11 +3,13 @@
...
@@ -3,11 +3,13 @@
import
json
import
json
from
operator
import
itemgetter
from
operator
import
itemgetter
from
nose.plugins.attrib
import
attr
from
.
import
BaseTestXmodule
from
.
import
BaseTestXmodule
from
xmodule.x_module
import
STUDENT_VIEW
from
xmodule.x_module
import
STUDENT_VIEW
@attr
(
'shard_1'
)
class
TestWordCloud
(
BaseTestXmodule
):
class
TestWordCloud
(
BaseTestXmodule
):
"""Integration test for word cloud xmodule."""
"""Integration test for word cloud xmodule."""
CATEGORY
=
"word_cloud"
CATEGORY
=
"word_cloud"
...
...
lms/djangoapps/courseware/tests/tests.py
View file @
ddb1ae66
...
@@ -6,6 +6,7 @@ from unittest import TestCase
...
@@ -6,6 +6,7 @@ from unittest import TestCase
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
import
mock
import
mock
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
...
@@ -17,6 +18,7 @@ from xmodule.modulestore.django import modulestore
...
@@ -17,6 +18,7 @@ from xmodule.modulestore.django import modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
@attr
(
'shard_1'
)
class
ActivateLoginTest
(
LoginEnrollmentTestCase
):
class
ActivateLoginTest
(
LoginEnrollmentTestCase
):
"""
"""
Test logging in and logging out.
Test logging in and logging out.
...
@@ -112,6 +114,7 @@ class PageLoaderTestCase(LoginEnrollmentTestCase):
...
@@ -112,6 +114,7 @@ class PageLoaderTestCase(LoginEnrollmentTestCase):
self
.
assertNotIsInstance
(
descriptor
,
ErrorDescriptor
)
self
.
assertNotIsInstance
(
descriptor
,
ErrorDescriptor
)
@attr
(
'shard_1'
)
class
TestXmlCoursesLoad
(
ModuleStoreTestCase
,
PageLoaderTestCase
):
class
TestXmlCoursesLoad
(
ModuleStoreTestCase
,
PageLoaderTestCase
):
"""
"""
Check that all pages in test courses load properly from XML.
Check that all pages in test courses load properly from XML.
...
@@ -129,6 +132,7 @@ class TestXmlCoursesLoad(ModuleStoreTestCase, PageLoaderTestCase):
...
@@ -129,6 +132,7 @@ class TestXmlCoursesLoad(ModuleStoreTestCase, PageLoaderTestCase):
self
.
check_all_pages_load
(
SlashSeparatedCourseKey
(
'edX'
,
'toy'
,
'2012_Fall'
))
self
.
check_all_pages_load
(
SlashSeparatedCourseKey
(
'edX'
,
'toy'
,
'2012_Fall'
))
@attr
(
'shard_1'
)
class
TestMongoCoursesLoad
(
ModuleStoreTestCase
,
PageLoaderTestCase
):
class
TestMongoCoursesLoad
(
ModuleStoreTestCase
,
PageLoaderTestCase
):
"""
"""
Check that all pages in test courses load properly from Mongo.
Check that all pages in test courses load properly from Mongo.
...
@@ -152,6 +156,7 @@ class TestMongoCoursesLoad(ModuleStoreTestCase, PageLoaderTestCase):
...
@@ -152,6 +156,7 @@ class TestMongoCoursesLoad(ModuleStoreTestCase, PageLoaderTestCase):
self
.
assertGreater
(
len
(
course
.
textbooks
),
0
)
self
.
assertGreater
(
len
(
course
.
textbooks
),
0
)
@attr
(
'shard_1'
)
class
TestDraftModuleStore
(
ModuleStoreTestCase
):
class
TestDraftModuleStore
(
ModuleStoreTestCase
):
def
test_get_items_with_course_items
(
self
):
def
test_get_items_with_course_items
(
self
):
store
=
modulestore
()
store
=
modulestore
()
...
@@ -164,6 +169,7 @@ class TestDraftModuleStore(ModuleStoreTestCase):
...
@@ -164,6 +169,7 @@ class TestDraftModuleStore(ModuleStoreTestCase):
# not allowed to be passed in (i.e. was throwing exception)
# not allowed to be passed in (i.e. was throwing exception)
@attr
(
'shard_1'
)
class
TestLmsFieldData
(
TestCase
):
class
TestLmsFieldData
(
TestCase
):
"""
"""
Tests of the LmsFieldData class
Tests of the LmsFieldData class
...
...
lms/djangoapps/dashboard/tests/test_support.py
View file @
ddb1ae66
...
@@ -5,6 +5,7 @@ import datetime
...
@@ -5,6 +5,7 @@ import datetime
from
django.contrib.auth.models
import
Permission
from
django.contrib.auth.models
import
Permission
from
django.test.client
import
Client
from
django.test.client
import
Client
from
nose.plugins.attrib
import
attr
from
course_modes.models
import
CourseMode
from
course_modes.models
import
CourseMode
from
shoppingcart.models
import
CertificateItem
,
Order
from
shoppingcart.models
import
CertificateItem
,
Order
...
@@ -14,6 +15,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
...
@@ -14,6 +15,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
@attr
(
'shard_1'
)
class
RefundTests
(
ModuleStoreTestCase
):
class
RefundTests
(
ModuleStoreTestCase
):
"""
"""
Tests for the manual refund page
Tests for the manual refund page
...
...
lms/djangoapps/dashboard/tests/test_sysadmin.py
View file @
ddb1ae66
...
@@ -7,6 +7,7 @@ import re
...
@@ -7,6 +7,7 @@ import re
import
shutil
import
shutil
import
unittest
import
unittest
from
util.date_utils
import
get_time_display
,
DEFAULT_DATE_TIME_FORMAT
from
util.date_utils
import
get_time_display
,
DEFAULT_DATE_TIME_FORMAT
from
nose.plugins.attrib
import
attr
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.auth.hashers
import
check_password
from
django.contrib.auth.hashers
import
check_password
...
@@ -115,6 +116,7 @@ class SysadminBaseTestCase(ModuleStoreTestCase):
...
@@ -115,6 +116,7 @@ class SysadminBaseTestCase(ModuleStoreTestCase):
self
.
addCleanup
(
shutil
.
rmtree
,
path
)
self
.
addCleanup
(
shutil
.
rmtree
,
path
)
@attr
(
'shard_1'
)
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'ENABLE_SYSADMIN_DASHBOARD'
),
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'ENABLE_SYSADMIN_DASHBOARD'
),
"ENABLE_SYSADMIN_DASHBOARD not set"
)
"ENABLE_SYSADMIN_DASHBOARD not set"
)
@override_settings
(
GIT_IMPORT_WITH_XMLMODULESTORE
=
True
)
@override_settings
(
GIT_IMPORT_WITH_XMLMODULESTORE
=
True
)
...
@@ -404,6 +406,7 @@ class TestSysadmin(SysadminBaseTestCase):
...
@@ -404,6 +406,7 @@ class TestSysadmin(SysadminBaseTestCase):
self
.
_rm_edx4edx
()
self
.
_rm_edx4edx
()
@attr
(
'shard_1'
)
@override_settings
(
MONGODB_LOG
=
TEST_MONGODB_LOG
)
@override_settings
(
MONGODB_LOG
=
TEST_MONGODB_LOG
)
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'ENABLE_SYSADMIN_DASHBOARD'
),
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'ENABLE_SYSADMIN_DASHBOARD'
),
"ENABLE_SYSADMIN_DASHBOARD not set"
)
"ENABLE_SYSADMIN_DASHBOARD not set"
)
...
...
lms/djangoapps/django_comment_client/tests/test_middleware.py
View file @
ddb1ae66
import
django.http
import
django.http
from
django.test
import
TestCase
from
django.test
import
TestCase
from
nose.plugins.attrib
import
attr
import
json
import
json
import
lms.lib.comment_client
import
lms.lib.comment_client
import
django_comment_client.middleware
as
middleware
import
django_comment_client.middleware
as
middleware
@attr
(
'shard_1'
)
class
AjaxExceptionTestCase
(
TestCase
):
class
AjaxExceptionTestCase
(
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
super
(
AjaxExceptionTestCase
,
self
)
.
setUp
()
super
(
AjaxExceptionTestCase
,
self
)
.
setUp
()
...
...
lms/djangoapps/django_comment_client/tests/test_models.py
View file @
ddb1ae66
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
Tests for the django comment client integration models
Tests for the django comment client integration models
"""
"""
from
django.test.testcases
import
TestCase
from
django.test.testcases
import
TestCase
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_MIXED_TOY_MODULESTORE
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_MIXED_TOY_MODULESTORE
...
@@ -9,6 +10,7 @@ import django_comment_common.models as models
...
@@ -9,6 +10,7 @@ import django_comment_common.models as models
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
@attr
(
'shard_1'
)
class
RoleClassTestCase
(
ModuleStoreTestCase
):
class
RoleClassTestCase
(
ModuleStoreTestCase
):
"""
"""
Tests for roles of the comment client service integration
Tests for roles of the comment client service integration
...
@@ -50,6 +52,7 @@ class RoleClassTestCase(ModuleStoreTestCase):
...
@@ -50,6 +52,7 @@ class RoleClassTestCase(ModuleStoreTestCase):
self
.
TA_role_2
.
inherit_permissions
(
self
.
TA_role
)
self
.
TA_role_2
.
inherit_permissions
(
self
.
TA_role
)
@attr
(
'shard_1'
)
class
PermissionClassTestCase
(
TestCase
):
class
PermissionClassTestCase
(
TestCase
):
"""
"""
Tests for permissions of the comment client service integration
Tests for permissions of the comment client service integration
...
...
lms/djangoapps/django_comment_client/tests/test_utils.py
View file @
ddb1ae66
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
datetime
import
datetime
import
json
import
json
import
mock
import
mock
from
nose.plugins.attrib
import
attr
from
pytz
import
UTC
from
pytz
import
UTC
from
django.utils.timezone
import
UTC
as
django_utc
from
django.utils.timezone
import
UTC
as
django_utc
...
@@ -24,6 +25,7 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
...
@@ -24,6 +25,7 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
@attr
(
'shard_1'
)
class
DictionaryTestCase
(
TestCase
):
class
DictionaryTestCase
(
TestCase
):
def
test_extract
(
self
):
def
test_extract
(
self
):
d
=
{
'cats'
:
'meow'
,
'dogs'
:
'woof'
}
d
=
{
'cats'
:
'meow'
,
'dogs'
:
'woof'
}
...
@@ -48,6 +50,7 @@ class DictionaryTestCase(TestCase):
...
@@ -48,6 +50,7 @@ class DictionaryTestCase(TestCase):
self
.
assertEqual
(
utils
.
merge_dict
(
d1
,
d2
),
expected
)
self
.
assertEqual
(
utils
.
merge_dict
(
d1
,
d2
),
expected
)
@attr
(
'shard_1'
)
class
AccessUtilsTestCase
(
ModuleStoreTestCase
):
class
AccessUtilsTestCase
(
ModuleStoreTestCase
):
"""
"""
Base testcase class for access and roles for the
Base testcase class for access and roles for the
...
@@ -90,6 +93,7 @@ class AccessUtilsTestCase(ModuleStoreTestCase):
...
@@ -90,6 +93,7 @@ class AccessUtilsTestCase(ModuleStoreTestCase):
self
.
assertFalse
(
ret
)
self
.
assertFalse
(
ret
)
@attr
(
'shard_1'
)
class
CoursewareContextTestCase
(
ModuleStoreTestCase
):
class
CoursewareContextTestCase
(
ModuleStoreTestCase
):
"""
"""
Base testcase class for courseware context for the
Base testcase class for courseware context for the
...
@@ -168,6 +172,7 @@ class CategoryMapTestMixin(object):
...
@@ -168,6 +172,7 @@ class CategoryMapTestMixin(object):
)
)
@attr
(
'shard_1'
)
class
CategoryMapTestCase
(
CategoryMapTestMixin
,
ModuleStoreTestCase
):
class
CategoryMapTestCase
(
CategoryMapTestMixin
,
ModuleStoreTestCase
):
"""
"""
Base testcase class for discussion categories for the
Base testcase class for discussion categories for the
...
@@ -759,6 +764,7 @@ class CategoryMapTestCase(CategoryMapTestMixin, ModuleStoreTestCase):
...
@@ -759,6 +764,7 @@ class CategoryMapTestCase(CategoryMapTestMixin, ModuleStoreTestCase):
)
)
@attr
(
'shard_1'
)
class
ContentGroupCategoryMapTestCase
(
CategoryMapTestMixin
,
ContentGroupTestCase
):
class
ContentGroupCategoryMapTestCase
(
CategoryMapTestMixin
,
ContentGroupTestCase
):
"""
"""
Tests `get_discussion_category_map` on discussion modules which are
Tests `get_discussion_category_map` on discussion modules which are
...
@@ -932,6 +938,7 @@ class JsonResponseTestCase(TestCase, UnicodeTestMixin):
...
@@ -932,6 +938,7 @@ class JsonResponseTestCase(TestCase, UnicodeTestMixin):
self
.
assertEqual
(
reparsed
,
text
)
self
.
assertEqual
(
reparsed
,
text
)
@attr
(
'shard_1'
)
class
RenderMustacheTests
(
TestCase
):
class
RenderMustacheTests
(
TestCase
):
"""
"""
Test the `render_mustache` utility function.
Test the `render_mustache` utility function.
...
...
lms/djangoapps/instructor/tests/test_access.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ Test instructor.access
...
@@ -3,6 +3,7 @@ Test instructor.access
"""
"""
from
nose.tools
import
raises
from
nose.tools
import
raises
from
nose.plugins.attrib
import
attr
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -17,6 +18,7 @@ from instructor.access import (allow_access,
...
@@ -17,6 +18,7 @@ from instructor.access import (allow_access,
update_forum_role
)
update_forum_role
)
@attr
(
'shard_1'
)
class
TestInstructorAccessList
(
ModuleStoreTestCase
):
class
TestInstructorAccessList
(
ModuleStoreTestCase
):
""" Test access listings. """
""" Test access listings. """
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -40,6 +42,7 @@ class TestInstructorAccessList(ModuleStoreTestCase):
...
@@ -40,6 +42,7 @@ class TestInstructorAccessList(ModuleStoreTestCase):
self
.
assertEqual
(
set
(
beta_testers
),
set
(
self
.
beta_testers
))
self
.
assertEqual
(
set
(
beta_testers
),
set
(
self
.
beta_testers
))
@attr
(
'shard_1'
)
class
TestInstructorAccessAllow
(
ModuleStoreTestCase
):
class
TestInstructorAccessAllow
(
ModuleStoreTestCase
):
""" Test access allow. """
""" Test access allow. """
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -75,6 +78,7 @@ class TestInstructorAccessAllow(ModuleStoreTestCase):
...
@@ -75,6 +78,7 @@ class TestInstructorAccessAllow(ModuleStoreTestCase):
allow_access
(
self
.
course
,
user
,
'staff'
)
allow_access
(
self
.
course
,
user
,
'staff'
)
@attr
(
'shard_1'
)
class
TestInstructorAccessRevoke
(
ModuleStoreTestCase
):
class
TestInstructorAccessRevoke
(
ModuleStoreTestCase
):
""" Test access revoke. """
""" Test access revoke. """
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -110,6 +114,7 @@ class TestInstructorAccessRevoke(ModuleStoreTestCase):
...
@@ -110,6 +114,7 @@ class TestInstructorAccessRevoke(ModuleStoreTestCase):
revoke_access
(
self
.
course
,
user
,
'robot-not-a-level'
)
revoke_access
(
self
.
course
,
user
,
'robot-not-a-level'
)
@attr
(
'shard_1'
)
class
TestInstructorAccessForum
(
ModuleStoreTestCase
):
class
TestInstructorAccessForum
(
ModuleStoreTestCase
):
"""
"""
Test forum access control.
Test forum access control.
...
...
lms/djangoapps/instructor/tests/test_api.py
View file @
ddb1ae66
...
@@ -27,6 +27,7 @@ from django.utils.translation import ugettext as _
...
@@ -27,6 +27,7 @@ from django.utils.translation import ugettext as _
from
mock
import
Mock
,
patch
from
mock
import
Mock
,
patch
from
nose.tools
import
raises
from
nose.tools
import
raises
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
course_modes.models
import
CourseMode
from
course_modes.models
import
CourseMode
...
@@ -107,6 +108,7 @@ def view_alreadyrunningerror(request): # pylint: disable=unused-argument
...
@@ -107,6 +108,7 @@ def view_alreadyrunningerror(request): # pylint: disable=unused-argument
raise
AlreadyRunningError
()
raise
AlreadyRunningError
()
@attr
(
'shard_1'
)
class
TestCommonExceptions400
(
TestCase
):
class
TestCommonExceptions400
(
TestCase
):
"""
"""
Testing the common_exceptions_400 decorator.
Testing the common_exceptions_400 decorator.
...
@@ -148,6 +150,7 @@ class TestCommonExceptions400(TestCase):
...
@@ -148,6 +150,7 @@ class TestCommonExceptions400(TestCase):
self
.
assertIn
(
"Task is already running"
,
result
[
"error"
])
self
.
assertIn
(
"Task is already running"
,
result
[
"error"
])
@attr
(
'shard_1'
)
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
class
TestInstructorAPIDenyLevels
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorAPIDenyLevels
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
...
@@ -304,6 +307,7 @@ class TestInstructorAPIDenyLevels(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -304,6 +307,7 @@ class TestInstructorAPIDenyLevels(ModuleStoreTestCase, LoginEnrollmentTestCase):
)
)
@attr
(
'shard_1'
)
@patch.dict
(
settings
.
FEATURES
,
{
'ALLOW_AUTOMATED_SIGNUPS'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'ALLOW_AUTOMATED_SIGNUPS'
:
True
})
class
TestInstructorAPIBulkAccountCreationAndEnrollment
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorAPIBulkAccountCreationAndEnrollment
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
...
@@ -560,6 +564,7 @@ class TestInstructorAPIBulkAccountCreationAndEnrollment(ModuleStoreTestCase, Log
...
@@ -560,6 +564,7 @@ class TestInstructorAPIBulkAccountCreationAndEnrollment(ModuleStoreTestCase, Log
self
.
assertEquals
(
response
.
status_code
,
403
)
self
.
assertEquals
(
response
.
status_code
,
403
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
TestInstructorAPIEnrollment
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorAPIEnrollment
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
...
@@ -1141,6 +1146,7 @@ class TestInstructorAPIEnrollment(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -1141,6 +1146,7 @@ class TestInstructorAPIEnrollment(ModuleStoreTestCase, LoginEnrollmentTestCase):
return
response
return
response
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
TestInstructorAPIBulkBetaEnrollment
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorAPIBulkBetaEnrollment
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
...
@@ -1456,6 +1462,7 @@ class TestInstructorAPIBulkBetaEnrollment(ModuleStoreTestCase, LoginEnrollmentTe
...
@@ -1456,6 +1462,7 @@ class TestInstructorAPIBulkBetaEnrollment(ModuleStoreTestCase, LoginEnrollmentTe
)
)
@attr
(
'shard_1'
)
class
TestInstructorAPILevelsAccess
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorAPILevelsAccess
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
Test endpoints whereby instructors can change permissions
Test endpoints whereby instructors can change permissions
...
@@ -1694,6 +1701,7 @@ class TestInstructorAPILevelsAccess(ModuleStoreTestCase, LoginEnrollmentTestCase
...
@@ -1694,6 +1701,7 @@ class TestInstructorAPILevelsAccess(ModuleStoreTestCase, LoginEnrollmentTestCase
self
.
assertNotIn
(
rolename
,
user_roles
)
self
.
assertNotIn
(
rolename
,
user_roles
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_PAID_COURSE_REGISTRATION'
:
True
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_PAID_COURSE_REGISTRATION'
:
True
})
class
TestInstructorAPILevelsDataDump
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorAPILevelsDataDump
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
...
@@ -2156,6 +2164,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
...
@@ -2156,6 +2164,7 @@ class TestInstructorAPILevelsDataDump(ModuleStoreTestCase, LoginEnrollmentTestCa
self
.
assertEqual
(
response
.
status_code
,
400
)
self
.
assertEqual
(
response
.
status_code
,
400
)
@attr
(
'shard_1'
)
class
TestInstructorAPIRegradeTask
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorAPIRegradeTask
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
Test endpoints whereby instructors can change student grades.
Test endpoints whereby instructors can change student grades.
...
@@ -2317,6 +2326,7 @@ class TestInstructorAPIRegradeTask(ModuleStoreTestCase, LoginEnrollmentTestCase)
...
@@ -2317,6 +2326,7 @@ class TestInstructorAPIRegradeTask(ModuleStoreTestCase, LoginEnrollmentTestCase)
self
.
assertEqual
(
response
.
status_code
,
400
)
self
.
assertEqual
(
response
.
status_code
,
400
)
@attr
(
'shard_1'
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENTRANCE_EXAMS'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENTRANCE_EXAMS'
:
True
})
class
TestEntranceExamInstructorAPIRegradeTask
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestEntranceExamInstructorAPIRegradeTask
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
...
@@ -2561,6 +2571,7 @@ class TestEntranceExamInstructorAPIRegradeTask(ModuleStoreTestCase, LoginEnrollm
...
@@ -2561,6 +2571,7 @@ class TestEntranceExamInstructorAPIRegradeTask(ModuleStoreTestCase, LoginEnrollm
self
.
assertContains
(
response
,
message
)
self
.
assertContains
(
response
,
message
)
@attr
(
'shard_1'
)
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
class
TestInstructorSendEmail
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorSendEmail
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
...
@@ -2645,6 +2656,7 @@ class MockCompletionInfo(object):
...
@@ -2645,6 +2656,7 @@ class MockCompletionInfo(object):
return
False
,
'Task Errored In Some Way'
return
False
,
'Task Errored In Some Way'
@attr
(
'shard_1'
)
class
TestInstructorAPITaskLists
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorAPITaskLists
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
Test instructor task list endpoint.
Test instructor task list endpoint.
...
@@ -2803,6 +2815,7 @@ class TestInstructorAPITaskLists(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -2803,6 +2815,7 @@ class TestInstructorAPITaskLists(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertEqual
(
actual_tasks
,
expected_tasks
)
self
.
assertEqual
(
actual_tasks
,
expected_tasks
)
@attr
(
'shard_1'
)
@patch.object
(
instructor_task
.
api
,
'get_instructor_task_history'
)
@patch.object
(
instructor_task
.
api
,
'get_instructor_task_history'
)
class
TestInstructorEmailContentList
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorEmailContentList
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
...
@@ -2933,6 +2946,7 @@ class TestInstructorEmailContentList(ModuleStoreTestCase, LoginEnrollmentTestCas
...
@@ -2933,6 +2946,7 @@ class TestInstructorEmailContentList(ModuleStoreTestCase, LoginEnrollmentTestCas
self
.
assertDictEqual
(
expected_info
,
returned_info
)
self
.
assertDictEqual
(
expected_info
,
returned_info
)
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
@override_settings
(
ANALYTICS_SERVER_URL
=
"http://robotanalyticsserver.netbot:900/"
)
@override_settings
(
ANALYTICS_SERVER_URL
=
"http://robotanalyticsserver.netbot:900/"
)
@override_settings
(
ANALYTICS_API_KEY
=
"robot_api_key"
)
@override_settings
(
ANALYTICS_API_KEY
=
"robot_api_key"
)
...
@@ -3081,6 +3095,7 @@ class TestInstructorAPIAnalyticsProxy(ModuleStoreTestCase, LoginEnrollmentTestCa
...
@@ -3081,6 +3095,7 @@ class TestInstructorAPIAnalyticsProxy(ModuleStoreTestCase, LoginEnrollmentTestCa
self
.
assertFalse
(
act
.
called
)
self
.
assertFalse
(
act
.
called
)
@attr
(
'shard_1'
)
class
TestInstructorAPIHelpers
(
TestCase
):
class
TestInstructorAPIHelpers
(
TestCase
):
""" Test helpers for instructor.api """
""" Test helpers for instructor.api """
...
@@ -3134,6 +3149,7 @@ def get_extended_due(course, unit, user):
...
@@ -3134,6 +3149,7 @@ def get_extended_due(course, unit, user):
return
None
return
None
@attr
(
'shard_1'
)
class
TestDueDateExtensions
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestDueDateExtensions
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
Test data dumps for reporting.
Test data dumps for reporting.
...
@@ -3322,6 +3338,7 @@ class TestDueDateExtensions(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -3322,6 +3338,7 @@ class TestDueDateExtensions(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
user1
.
profile
.
name
,
self
.
user1
.
username
)})
self
.
user1
.
profile
.
name
,
self
.
user1
.
username
)})
@attr
(
'shard_1'
)
@override_settings
(
REGISTRATION_CODE_LENGTH
=
8
)
@override_settings
(
REGISTRATION_CODE_LENGTH
=
8
)
class
TestCourseRegistrationCodes
(
ModuleStoreTestCase
):
class
TestCourseRegistrationCodes
(
ModuleStoreTestCase
):
"""
"""
...
@@ -3773,6 +3790,7 @@ class TestCourseRegistrationCodes(ModuleStoreTestCase):
...
@@ -3773,6 +3790,7 @@ class TestCourseRegistrationCodes(ModuleStoreTestCase):
self
.
assertTrue
(
body
.
startswith
(
EXPECTED_COUPON_CSV_HEADER
))
self
.
assertTrue
(
body
.
startswith
(
EXPECTED_COUPON_CSV_HEADER
))
@attr
(
'shard_1'
)
class
TestBulkCohorting
(
ModuleStoreTestCase
):
class
TestBulkCohorting
(
ModuleStoreTestCase
):
"""
"""
Test adding users to cohorts in bulk via CSV upload.
Test adding users to cohorts in bulk via CSV upload.
...
...
lms/djangoapps/instructor/tests/test_api_email_localization.py
View file @
ddb1ae66
...
@@ -5,6 +5,7 @@ Unit tests for the localization of emails sent by instructor.api methods.
...
@@ -5,6 +5,7 @@ Unit tests for the localization of emails sent by instructor.api methods.
from
django.core
import
mail
from
django.core
import
mail
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
nose.plugins.attrib
import
attr
from
courseware.tests.factories
import
InstructorFactory
from
courseware.tests.factories
import
InstructorFactory
from
lang_pref
import
LANGUAGE_KEY
from
lang_pref
import
LANGUAGE_KEY
...
@@ -15,6 +16,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
...
@@ -15,6 +16,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
@attr
(
'shard_1'
)
class
TestInstructorAPIEnrollmentEmailLocalization
(
ModuleStoreTestCase
):
class
TestInstructorAPIEnrollmentEmailLocalization
(
ModuleStoreTestCase
):
"""
"""
Test whether the enroll, unenroll and beta role emails are sent in the
Test whether the enroll, unenroll and beta role emails are sent in the
...
...
lms/djangoapps/instructor/tests/test_certificates.py
View file @
ddb1ae66
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
contextlib
import
contextlib
import
ddt
import
ddt
import
mock
import
mock
from
nose.plugins.attrib
import
attr
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -12,6 +13,7 @@ from certificates.models import CertificateGenerationConfiguration
...
@@ -12,6 +13,7 @@ from certificates.models import CertificateGenerationConfiguration
from
certificates
import
api
as
certs_api
from
certificates
import
api
as
certs_api
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
CertificatesInstructorDashTest
(
ModuleStoreTestCase
):
class
CertificatesInstructorDashTest
(
ModuleStoreTestCase
):
"""Tests for the certificate panel of the instructor dash. """
"""Tests for the certificate panel of the instructor dash. """
...
@@ -148,6 +150,7 @@ class CertificatesInstructorDashTest(ModuleStoreTestCase):
...
@@ -148,6 +150,7 @@ class CertificatesInstructorDashTest(ModuleStoreTestCase):
self
.
assertContains
(
response
,
expected_html
)
self
.
assertContains
(
response
,
expected_html
)
@attr
(
'shard_1'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
@override_settings
(
CERT_QUEUE
=
'certificates'
)
@ddt.ddt
@ddt.ddt
class
CertificatesInstructorApiTest
(
ModuleStoreTestCase
):
class
CertificatesInstructorApiTest
(
ModuleStoreTestCase
):
...
...
lms/djangoapps/instructor/tests/test_ecommerce.py
View file @
ddb1ae66
...
@@ -7,6 +7,7 @@ import datetime
...
@@ -7,6 +7,7 @@ import datetime
import
pytz
import
pytz
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
nose.plugins.attrib
import
attr
from
course_modes.models
import
CourseMode
from
course_modes.models
import
CourseMode
from
student.roles
import
CourseFinanceAdminRole
from
student.roles
import
CourseFinanceAdminRole
...
@@ -16,6 +17,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...
@@ -16,6 +17,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
@attr
(
'shard_1'
)
class
TestECommerceDashboardViews
(
ModuleStoreTestCase
):
class
TestECommerceDashboardViews
(
ModuleStoreTestCase
):
"""
"""
Check for E-commerce view on the new instructor dashboard
Check for E-commerce view on the new instructor dashboard
...
...
lms/djangoapps/instructor/tests/test_email.py
View file @
ddb1ae66
...
@@ -7,6 +7,7 @@ that the view is conditionally available when Course Auth is turned on.
...
@@ -7,6 +7,7 @@ that the view is conditionally available when Course Auth is turned on.
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
bulk_email.models
import
CourseAuthorization
from
bulk_email.models
import
CourseAuthorization
...
@@ -15,6 +16,7 @@ from student.tests.factories import AdminFactory
...
@@ -15,6 +16,7 @@ from student.tests.factories import AdminFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
@attr
(
'shard_1'
)
class
TestNewInstructorDashboardEmailViewMongoBacked
(
ModuleStoreTestCase
):
class
TestNewInstructorDashboardEmailViewMongoBacked
(
ModuleStoreTestCase
):
"""
"""
Check for email view on the new instructor dashboard
Check for email view on the new instructor dashboard
...
@@ -98,6 +100,7 @@ class TestNewInstructorDashboardEmailViewMongoBacked(ModuleStoreTestCase):
...
@@ -98,6 +100,7 @@ class TestNewInstructorDashboardEmailViewMongoBacked(ModuleStoreTestCase):
self
.
assertFalse
(
self
.
email_link
in
response
.
content
)
self
.
assertFalse
(
self
.
email_link
in
response
.
content
)
@attr
(
'shard_1'
)
class
TestNewInstructorDashboardEmailViewXMLBacked
(
ModuleStoreTestCase
):
class
TestNewInstructorDashboardEmailViewXMLBacked
(
ModuleStoreTestCase
):
"""
"""
Check for email view on the new instructor dashboard
Check for email view on the new instructor dashboard
...
...
lms/djangoapps/instructor/tests/test_enrollment.py
View file @
ddb1ae66
...
@@ -11,6 +11,7 @@ from django.conf import settings
...
@@ -11,6 +11,7 @@ from django.conf import settings
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.utils.translation
import
get_language
from
django.utils.translation
import
get_language
from
django.utils.translation
import
override
as
override_language
from
django.utils.translation
import
override
as
override_language
from
nose.plugins.attrib
import
attr
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
...
@@ -31,6 +32,7 @@ from student.models import anonymous_id_for_user
...
@@ -31,6 +32,7 @@ from student.models import anonymous_id_for_user
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
@attr
(
'shard_1'
)
class
TestSettableEnrollmentState
(
TestCase
):
class
TestSettableEnrollmentState
(
TestCase
):
""" Test the basis class for enrollment tests. """
""" Test the basis class for enrollment tests. """
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -94,6 +96,7 @@ class TestEnrollmentChangeBase(TestCase):
...
@@ -94,6 +96,7 @@ class TestEnrollmentChangeBase(TestCase):
self
.
assertEqual
(
after
,
after_ideal
)
self
.
assertEqual
(
after
,
after_ideal
)
@attr
(
'shard_1'
)
class
TestInstructorEnrollDB
(
TestEnrollmentChangeBase
):
class
TestInstructorEnrollDB
(
TestEnrollmentChangeBase
):
""" Test instructor.enrollment.enroll_email """
""" Test instructor.enrollment.enroll_email """
def
test_enroll
(
self
):
def
test_enroll
(
self
):
...
@@ -211,6 +214,7 @@ class TestInstructorEnrollDB(TestEnrollmentChangeBase):
...
@@ -211,6 +214,7 @@ class TestInstructorEnrollDB(TestEnrollmentChangeBase):
return
self
.
_run_state_change_test
(
before_ideal
,
after_ideal
,
action
)
return
self
.
_run_state_change_test
(
before_ideal
,
after_ideal
,
action
)
@attr
(
'shard_1'
)
class
TestInstructorUnenrollDB
(
TestEnrollmentChangeBase
):
class
TestInstructorUnenrollDB
(
TestEnrollmentChangeBase
):
""" Test instructor.enrollment.unenroll_email """
""" Test instructor.enrollment.unenroll_email """
def
test_unenroll
(
self
):
def
test_unenroll
(
self
):
...
@@ -290,6 +294,7 @@ class TestInstructorUnenrollDB(TestEnrollmentChangeBase):
...
@@ -290,6 +294,7 @@ class TestInstructorUnenrollDB(TestEnrollmentChangeBase):
return
self
.
_run_state_change_test
(
before_ideal
,
after_ideal
,
action
)
return
self
.
_run_state_change_test
(
before_ideal
,
after_ideal
,
action
)
@attr
(
'shard_1'
)
class
TestInstructorEnrollmentStudentModule
(
TestCase
):
class
TestInstructorEnrollmentStudentModule
(
TestCase
):
""" Test student module manipulations. """
""" Test student module manipulations. """
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -419,6 +424,7 @@ class SettableEnrollmentState(EmailEnrollmentState):
...
@@ -419,6 +424,7 @@ class SettableEnrollmentState(EmailEnrollmentState):
return
EnrollmentObjects
(
email
,
None
,
None
,
None
)
return
EnrollmentObjects
(
email
,
None
,
None
,
None
)
@attr
(
'shard_1'
)
class
TestSendBetaRoleEmail
(
TestCase
):
class
TestSendBetaRoleEmail
(
TestCase
):
"""
"""
Test edge cases for `send_beta_role_email`
Test edge cases for `send_beta_role_email`
...
@@ -436,6 +442,7 @@ class TestSendBetaRoleEmail(TestCase):
...
@@ -436,6 +442,7 @@ class TestSendBetaRoleEmail(TestCase):
send_beta_role_email
(
bad_action
,
self
.
user
,
self
.
email_params
)
send_beta_role_email
(
bad_action
,
self
.
user
,
self
.
email_params
)
@attr
(
'shard_1'
)
class
TestGetEmailParams
(
ModuleStoreTestCase
):
class
TestGetEmailParams
(
ModuleStoreTestCase
):
"""
"""
Test what URLs the function get_email_params returns under different
Test what URLs the function get_email_params returns under different
...
@@ -480,6 +487,7 @@ class TestGetEmailParams(ModuleStoreTestCase):
...
@@ -480,6 +487,7 @@ class TestGetEmailParams(ModuleStoreTestCase):
self
.
assertEqual
(
result
[
'course_url'
],
self
.
course_url
)
self
.
assertEqual
(
result
[
'course_url'
],
self
.
course_url
)
@attr
(
'shard_1'
)
class
TestRenderMessageToString
(
ModuleStoreTestCase
):
class
TestRenderMessageToString
(
ModuleStoreTestCase
):
"""
"""
Test that email templates can be rendered in a language chosen manually.
Test that email templates can be rendered in a language chosen manually.
...
...
lms/djangoapps/instructor/tests/test_hint_manager.py
View file @
ddb1ae66
...
@@ -2,6 +2,7 @@ import json
...
@@ -2,6 +2,7 @@ import json
from
django.test.client
import
Client
,
RequestFactory
from
django.test.client
import
Client
,
RequestFactory
from
mock
import
patch
,
MagicMock
from
mock
import
patch
,
MagicMock
from
nose.plugins.attrib
import
attr
from
courseware.models
import
XModuleUserStateSummaryField
from
courseware.models
import
XModuleUserStateSummaryField
from
courseware.tests.factories
import
UserStateSummaryFactory
from
courseware.tests.factories
import
UserStateSummaryFactory
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.tests.factories import CourseFactory
# pylint: disable=missing-docstring
# pylint: disable=missing-docstring
@attr
(
'shard_1'
)
class
HintManagerTest
(
ModuleStoreTestCase
):
class
HintManagerTest
(
ModuleStoreTestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
lms/djangoapps/instructor/tests/test_legacy_enrollment.py
View file @
ddb1ae66
...
@@ -5,6 +5,7 @@ Unit tests for enrollment methods in views.py
...
@@ -5,6 +5,7 @@ Unit tests for enrollment methods in views.py
import
ddt
import
ddt
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -19,6 +20,7 @@ from django.core import mail
...
@@ -19,6 +20,7 @@ from django.core import mail
USER_COUNT
=
4
USER_COUNT
=
4
@attr
(
'shard_1'
)
@ddt.ddt
@ddt.ddt
class
TestInstructorEnrollsStudent
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestInstructorEnrollsStudent
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
...
...
lms/djangoapps/instructor/tests/test_legacy_raw_download_csv.py
View file @
ddb1ae66
...
@@ -5,11 +5,13 @@ Create course and answer a problem to test raw grade CSV
...
@@ -5,11 +5,13 @@ Create course and answer a problem to test raw grade CSV
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
nose.plugins.attrib
import
attr
from
courseware.tests.test_submitting_problems
import
TestSubmittingProblems
from
courseware.tests.test_submitting_problems
import
TestSubmittingProblems
from
student.roles
import
CourseStaffRole
from
student.roles
import
CourseStaffRole
@attr
(
'shard_1'
)
class
TestRawGradeCSV
(
TestSubmittingProblems
):
class
TestRawGradeCSV
(
TestSubmittingProblems
):
"""
"""
Tests around the instructor dashboard raw grade CSV
Tests around the instructor dashboard raw grade CSV
...
...
lms/djangoapps/instructor/tests/test_legacy_xss.py
View file @
ddb1ae66
...
@@ -5,6 +5,7 @@ Tests of various instructor dashboard features that include lists of students
...
@@ -5,6 +5,7 @@ Tests of various instructor dashboard features that include lists of students
from
django.conf
import
settings
from
django.conf
import
settings
from
django.test.client
import
RequestFactory
from
django.test.client
import
RequestFactory
from
markupsafe
import
escape
from
markupsafe
import
escape
from
nose.plugins.attrib
import
attr
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
edxmako.tests
import
mako_middleware_process_request
from
edxmako.tests
import
mako_middleware_process_request
...
@@ -16,6 +17,7 @@ from instructor.views import legacy
...
@@ -16,6 +17,7 @@ from instructor.views import legacy
# pylint: disable=missing-docstring
# pylint: disable=missing-docstring
@attr
(
'shard_1'
)
class
TestXss
(
ModuleStoreTestCase
):
class
TestXss
(
ModuleStoreTestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
super
(
TestXss
,
self
)
.
setUp
()
super
(
TestXss
,
self
)
.
setUp
()
...
...
lms/djangoapps/instructor/tests/test_spoc_gradebook.py
View file @
ddb1ae66
...
@@ -3,6 +3,7 @@ Tests of the instructor dashboard spoc gradebook
...
@@ -3,6 +3,7 @@ Tests of the instructor dashboard spoc gradebook
"""
"""
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
nose.plugins.attrib
import
attr
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
,
AdminFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
,
AdminFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -14,6 +15,7 @@ from xmodule.modulestore.django import modulestore
...
@@ -14,6 +15,7 @@ from xmodule.modulestore.django import modulestore
USER_COUNT
=
11
USER_COUNT
=
11
@attr
(
'shard_1'
)
class
TestGradebook
(
ModuleStoreTestCase
):
class
TestGradebook
(
ModuleStoreTestCase
):
"""
"""
Test functionality of the spoc gradebook. Sets up a course with assignments and
Test functionality of the spoc gradebook. Sets up a course with assignments and
...
@@ -79,6 +81,7 @@ class TestGradebook(ModuleStoreTestCase):
...
@@ -79,6 +81,7 @@ class TestGradebook(ModuleStoreTestCase):
self
.
assertEquals
(
self
.
response
.
status_code
,
200
)
self
.
assertEquals
(
self
.
response
.
status_code
,
200
)
@attr
(
'shard_1'
)
class
TestDefaultGradingPolicy
(
TestGradebook
):
class
TestDefaultGradingPolicy
(
TestGradebook
):
"""
"""
Tests that the grading policy is properly applied for all users in the course
Tests that the grading policy is properly applied for all users in the course
...
@@ -104,6 +107,7 @@ class TestDefaultGradingPolicy(TestGradebook):
...
@@ -104,6 +107,7 @@ class TestDefaultGradingPolicy(TestGradebook):
self
.
assertEquals
(
293
,
self
.
response
.
content
.
count
(
'grade_None'
))
self
.
assertEquals
(
293
,
self
.
response
.
content
.
count
(
'grade_None'
))
@attr
(
'shard_1'
)
class
TestLetterCutoffPolicy
(
TestGradebook
):
class
TestLetterCutoffPolicy
(
TestGradebook
):
"""
"""
Tests advanced grading policy (with letter grade cutoffs). Includes tests of
Tests advanced grading policy (with letter grade cutoffs). Includes tests of
...
...
lms/djangoapps/instructor/tests/test_tools.py
View file @
ddb1ae66
...
@@ -9,6 +9,7 @@ import unittest
...
@@ -9,6 +9,7 @@ import unittest
from
django.utils.timezone
import
utc
from
django.utils.timezone
import
utc
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
nose.plugins.attrib
import
attr
from
courseware.field_overrides
import
OverrideFieldData
# pylint: disable=import-error
from
courseware.field_overrides
import
OverrideFieldData
# pylint: disable=import-error
from
student.tests.factories
import
UserFactory
# pylint: disable=import-error
from
student.tests.factories
import
UserFactory
# pylint: disable=import-error
...
@@ -22,6 +23,7 @@ from ..views import tools
...
@@ -22,6 +23,7 @@ from ..views import tools
DATE_FIELD
=
Date
()
DATE_FIELD
=
Date
()
@attr
(
'shard_1'
)
class
TestDashboardError
(
unittest
.
TestCase
):
class
TestDashboardError
(
unittest
.
TestCase
):
"""
"""
Test DashboardError exceptions.
Test DashboardError exceptions.
...
@@ -32,6 +34,7 @@ class TestDashboardError(unittest.TestCase):
...
@@ -32,6 +34,7 @@ class TestDashboardError(unittest.TestCase):
self
.
assertEqual
(
response
,
{
'error'
:
'Oh noes!'
})
self
.
assertEqual
(
response
,
{
'error'
:
'Oh noes!'
})
@attr
(
'shard_1'
)
class
TestHandleDashboardError
(
unittest
.
TestCase
):
class
TestHandleDashboardError
(
unittest
.
TestCase
):
"""
"""
Test handle_dashboard_error decorator.
Test handle_dashboard_error decorator.
...
@@ -60,6 +63,7 @@ class TestHandleDashboardError(unittest.TestCase):
...
@@ -60,6 +63,7 @@ class TestHandleDashboardError(unittest.TestCase):
self
.
assertEqual
(
view
(
None
,
None
),
"Oh yes!"
)
self
.
assertEqual
(
view
(
None
,
None
),
"Oh yes!"
)
@attr
(
'shard_1'
)
class
TestRequireStudentIdentifier
(
unittest
.
TestCase
):
class
TestRequireStudentIdentifier
(
unittest
.
TestCase
):
"""
"""
Test require_student_from_identifier()
Test require_student_from_identifier()
...
@@ -82,6 +86,7 @@ class TestRequireStudentIdentifier(unittest.TestCase):
...
@@ -82,6 +86,7 @@ class TestRequireStudentIdentifier(unittest.TestCase):
tools
.
require_student_from_identifier
(
"invalid"
)
tools
.
require_student_from_identifier
(
"invalid"
)
@attr
(
'shard_1'
)
class
TestParseDatetime
(
unittest
.
TestCase
):
class
TestParseDatetime
(
unittest
.
TestCase
):
"""
"""
Test date parsing.
Test date parsing.
...
@@ -96,6 +101,7 @@ class TestParseDatetime(unittest.TestCase):
...
@@ -96,6 +101,7 @@ class TestParseDatetime(unittest.TestCase):
tools
.
parse_datetime
(
'foo'
)
tools
.
parse_datetime
(
'foo'
)
@attr
(
'shard_1'
)
class
TestFindUnit
(
ModuleStoreTestCase
):
class
TestFindUnit
(
ModuleStoreTestCase
):
"""
"""
Test the find_unit function.
Test the find_unit function.
...
@@ -131,6 +137,7 @@ class TestFindUnit(ModuleStoreTestCase):
...
@@ -131,6 +137,7 @@ class TestFindUnit(ModuleStoreTestCase):
tools
.
find_unit
(
self
.
course
,
url
)
tools
.
find_unit
(
self
.
course
,
url
)
@attr
(
'shard_1'
)
class
TestGetUnitsWithDueDate
(
ModuleStoreTestCase
):
class
TestGetUnitsWithDueDate
(
ModuleStoreTestCase
):
"""
"""
Test the get_units_with_due_date function.
Test the get_units_with_due_date function.
...
@@ -166,6 +173,7 @@ class TestGetUnitsWithDueDate(ModuleStoreTestCase):
...
@@ -166,6 +173,7 @@ class TestGetUnitsWithDueDate(ModuleStoreTestCase):
urls
((
self
.
week1
,
self
.
week2
)))
urls
((
self
.
week1
,
self
.
week2
)))
@attr
(
'shard_1'
)
class
TestTitleOrUrl
(
unittest
.
TestCase
):
class
TestTitleOrUrl
(
unittest
.
TestCase
):
"""
"""
Test the title_or_url funciton.
Test the title_or_url funciton.
...
@@ -180,6 +188,7 @@ class TestTitleOrUrl(unittest.TestCase):
...
@@ -180,6 +188,7 @@ class TestTitleOrUrl(unittest.TestCase):
self
.
assertEquals
(
tools
.
title_or_url
(
unit
),
'test:hello'
)
self
.
assertEquals
(
tools
.
title_or_url
(
unit
),
'test:hello'
)
@attr
(
'shard_1'
)
@override_settings
(
@override_settings
(
FIELD_OVERRIDE_PROVIDERS
=
(
FIELD_OVERRIDE_PROVIDERS
=
(
'courseware.student_field_overrides.IndividualStudentOverrideProvider'
,),
'courseware.student_field_overrides.IndividualStudentOverrideProvider'
,),
...
@@ -265,6 +274,7 @@ class TestSetDueDateExtension(ModuleStoreTestCase):
...
@@ -265,6 +274,7 @@ class TestSetDueDateExtension(ModuleStoreTestCase):
self
.
assertEqual
(
self
.
week1
.
due
,
self
.
due
)
self
.
assertEqual
(
self
.
week1
.
due
,
self
.
due
)
@attr
(
'shard_1'
)
class
TestDataDumps
(
ModuleStoreTestCase
):
class
TestDataDumps
(
ModuleStoreTestCase
):
"""
"""
Test data dumps for reporting.
Test data dumps for reporting.
...
...
scripts/all-tests.sh
View file @
ddb1ae66
...
@@ -95,22 +95,25 @@ END
...
@@ -95,22 +95,25 @@ END
exit
$EXIT
exit
$EXIT
;;
;;
"unit"
)
"
lms-
unit"
)
case
"
$SHARD
"
in
case
"
$SHARD
"
in
"
lms
"
)
"
1
"
)
SHARD
=
1 paver test_system
-s
lms
--extra_args
=
"
--with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
paver test_system
-s
lms
--extra_args
=
"--attr='shard_1'
--with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
;;
;;
"cms-js-commonlib"
)
"2"
)
SHARD
=
1 paver test_system
-s
cms
--extra_args
=
"--with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
paver test_system
-s
lms
--extra_args
=
"--attr='shard_1=False' --with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
SHARD
=
1 paver test_js
--coverage
--skip_clean
||
{
EXIT
=
1
;
}
SHARD
=
1 paver test_lib
--skip_clean
--extra_args
=
"--with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
;;
;;
*
)
*
)
paver
test
--extra_args
=
"--with-flaky"
paver test_system
-s
lms
--extra_args
=
"--with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
paver coverage
;;
;;
esac
esac
exit
$EXIT
;;
"other-unit"
)
paver test_system
-s
cms
--extra_args
=
"--with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
paver test_js
--coverage
--skip_clean
||
{
EXIT
=
1
;
}
paver test_lib
--skip_clean
--extra_args
=
"--with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
exit
$EXIT
exit
$EXIT
;;
;;
...
...
scripts/jenkins-report.sh
View file @
ddb1ae66
...
@@ -7,6 +7,9 @@ paver combine_jenkins_coverage
...
@@ -7,6 +7,9 @@ paver combine_jenkins_coverage
# Get the diff coverage and html reports for unit tests
# Get the diff coverage and html reports for unit tests
paver coverage
paver coverage
# Get coverage reports for bok choy
# paver bokchoy_coverage
# JUnit test reporter will fail the build
# JUnit test reporter will fail the build
# if it thinks test results are old
# if it thinks test results are old
touch
`
find
.
-name
*
.xml
`
||
true
touch
`
find
.
-name
*
.xml
`
||
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