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
a1a5a0fc
Commit
a1a5a0fc
authored
Jul 24, 2016
by
Nimisha Asthagiri
Committed by
Sanford Student
Jul 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Milestones in LMS Tests
parent
99eb795a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
10 deletions
+22
-10
lms/djangoapps/course_api/blocks/tests/test_api.py
+2
-1
lms/djangoapps/course_api/blocks/tests/test_views.py
+2
-1
lms/djangoapps/courseware/tests/test_access.py
+2
-2
lms/djangoapps/courseware/tests/test_discussion_xblock.py
+2
-1
lms/djangoapps/instructor/tests/test_api.py
+8
-3
lms/djangoapps/mobile_api/users/tests.py
+1
-1
lms/djangoapps/mobile_api/video_outlines/tests.py
+2
-1
lms/envs/test.py
+3
-0
No files found.
lms/djangoapps/course_api/blocks/tests/test_api.py
View file @
a1a5a0fc
...
...
@@ -4,6 +4,7 @@ Tests for Blocks api.py
from
django.test.client
import
RequestFactory
from
milestones.tests.utils
import
MilestonesTestCaseMixin
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
...
...
@@ -12,7 +13,7 @@ from xmodule.modulestore.tests.factories import SampleCourseFactory
from
..api
import
get_blocks
class
TestGetBlocks
(
SharedModuleStoreTestCase
):
class
TestGetBlocks
(
SharedModuleStoreTestCase
,
MilestonesTestCaseMixin
):
"""
Tests for the get_blocks function
"""
...
...
lms/djangoapps/course_api/blocks/tests/test_views.py
View file @
a1a5a0fc
...
...
@@ -8,6 +8,7 @@ from string import join
from
urllib
import
urlencode
from
urlparse
import
urlunparse
from
milestones.tests.utils
import
MilestonesTestCaseMixin
from
opaque_keys.edx.locator
import
CourseLocator
from
student.models
import
CourseEnrollment
from
student.tests.factories
import
AdminFactory
,
CourseEnrollmentFactory
,
UserFactory
...
...
@@ -17,7 +18,7 @@ from xmodule.modulestore.tests.factories import ToyCourseFactory
from
.helpers
import
deserialize_usage_key
class
TestBlocksView
(
SharedModuleStoreTestCase
):
class
TestBlocksView
(
SharedModuleStoreTestCase
,
MilestonesTestCaseMixin
):
"""
Test class for BlocksView
"""
...
...
lms/djangoapps/courseware/tests/test_access.py
View file @
a1a5a0fc
...
...
@@ -557,7 +557,7 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, MilestonesTes
"""
Test course access on mobile for staff and students.
"""
descriptor
=
Mock
(
user_partitions
=
[])
descriptor
=
Mock
(
id
=
self
.
course
.
id
,
user_partitions
=
[])
descriptor
.
_class_tags
=
{}
descriptor
.
visible_to_staff_only
=
False
descriptor
.
mobile_available
=
mobile_available
...
...
@@ -697,7 +697,7 @@ class CourseOverviewAccessTestCase(ModuleStoreTestCase):
self
.
user_normal
=
UserFactory
.
create
()
self
.
user_beta_tester
=
BetaTesterFactory
.
create
(
course_key
=
self
.
course_not_started
.
id
)
self
.
user_completed_pre_requisite
=
UserFactory
.
create
()
fulfill_course_milestone
(
self
.
user_completed_pre_requisite
,
self
.
course_started
.
id
)
fulfill_course_milestone
(
self
.
course_started
.
id
,
self
.
user_completed_pre_requisite
)
self
.
user_staff
=
UserFactory
.
create
(
is_staff
=
True
)
self
.
user_anonymous
=
AnonymousUserFactory
.
create
()
...
...
lms/djangoapps/courseware/tests/test_discussion_xblock.py
View file @
a1a5a0fc
...
...
@@ -15,6 +15,7 @@ import mock
from
django.core.urlresolvers
import
reverse
from
course_api.blocks.tests.helpers
import
deserialize_usage_key
from
courseware.module_render
import
get_module_for_descriptor_internal
from
milestones.tests.utils
import
MilestonesTestCaseMixin
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
xblock.field_data
import
DictFieldData
from
xblock.fragment
import
Fragment
...
...
@@ -252,7 +253,7 @@ class TestTemplates(TestDiscussionXBlock):
@ddt.ddt
class
TestXBlockInCourse
(
SharedModuleStoreTestCase
):
class
TestXBlockInCourse
(
SharedModuleStoreTestCase
,
MilestonesTestCaseMixin
):
"""
Test the discussion xblock as rendered in the course and course API.
"""
...
...
lms/djangoapps/instructor/tests/test_api.py
View file @
a1a5a0fc
...
...
@@ -40,6 +40,7 @@ from courseware.tests.factories import (
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
django_comment_common.models
import
FORUM_ROLE_COMMUNITY_TA
from
django_comment_common.utils
import
seed_permissions_roles
from
milestones.tests.utils
import
MilestonesTestCaseMixin
from
shoppingcart.models
import
(
RegistrationCodeRedemption
,
Order
,
CouponRedemption
,
PaidCourseRegistration
,
Coupon
,
Invoice
,
CourseRegistrationCode
,
CourseRegistrationCodeInvoiceItem
,
...
...
@@ -3277,7 +3278,11 @@ class TestInstructorAPIRegradeTask(SharedModuleStoreTestCase, LoginEnrollmentTes
@attr
(
'shard_1'
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENTRANCE_EXAMS'
:
True
})
@ddt.ddt
class
TestEntranceExamInstructorAPIRegradeTask
(
SharedModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestEntranceExamInstructorAPIRegradeTask
(
SharedModuleStoreTestCase
,
LoginEnrollmentTestCase
,
MilestonesTestCaseMixin
):
"""
Test endpoints whereby instructors can rescore student grades,
reset student attempts and delete state for entrance exam.
...
...
@@ -3368,7 +3373,7 @@ class TestEntranceExamInstructorAPIRegradeTask(SharedModuleStoreTestCase, LoginE
self
.
assertEqual
(
grades
[
0
],
(
50.0
,
1
))
self
.
assertEqual
(
grades
[
1
],
(
100.0
,
1
))
def
test_reset_entrance_exam_student_attempts_deletall
(
self
):
def
test_reset_entrance_exam_student_attempts_delet
e_
all
(
self
):
""" Make sure no one can delete all students state on entrance exam. """
url
=
reverse
(
'reset_student_attempts_for_entrance_exam'
,
kwargs
=
{
'course_id'
:
unicode
(
self
.
course
.
id
)})
...
...
@@ -3415,7 +3420,7 @@ class TestEntranceExamInstructorAPIRegradeTask(SharedModuleStoreTestCase, LoginE
})
self
.
assertEqual
(
response
.
status_code
,
400
)
def
test_entrance_exam_st
t
udent_delete_state
(
self
):
def
test_entrance_exam_student_delete_state
(
self
):
""" Test delete single student entrance exam state. """
url
=
reverse
(
'reset_student_attempts_for_entrance_exam'
,
kwargs
=
{
'course_id'
:
unicode
(
self
.
course
.
id
)})
...
...
lms/djangoapps/mobile_api/users/tests.py
View file @
a1a5a0fc
...
...
@@ -430,7 +430,7 @@ class TestCourseStatusPATCH(CourseStatusAPITestCase, MobileAuthUserTestMixin,
@attr
(
'shard_2'
)
class
TestCourseEnrollmentSerializer
(
MobileAPITestCase
):
class
TestCourseEnrollmentSerializer
(
MobileAPITestCase
,
MilestonesTestCaseMixin
):
"""
Test the course enrollment serializer
"""
...
...
lms/djangoapps/mobile_api/video_outlines/tests.py
View file @
a1a5a0fc
...
...
@@ -10,6 +10,7 @@ from collections import namedtuple
import
ddt
from
nose.plugins.attrib
import
attr
from
edxval
import
api
from
milestones.tests.utils
import
MilestonesTestCaseMixin
from
xmodule.modulestore.tests.factories
import
ItemFactory
from
xmodule.video_module
import
transcripts_utils
from
xmodule.modulestore.django
import
modulestore
...
...
@@ -199,7 +200,7 @@ class TestVideoAPIMixin(object):
@attr
(
'shard_2'
)
class
TestNonStandardCourseStructure
(
MobileAPITestCase
,
TestVideoAPIMixin
):
class
TestNonStandardCourseStructure
(
MobileAPITestCase
,
TestVideoAPIMixin
,
MilestonesTestCaseMixin
):
"""
Tests /api/mobile/v0.5/video_outlines/courses/{course_id} with no course set
"""
...
...
lms/envs/test.py
View file @
a1a5a0fc
...
...
@@ -75,6 +75,9 @@ FEATURES['EMBARGO'] = True
FEATURES
[
'ENABLE_COMBINED_LOGIN_REGISTRATION'
]
=
True
# Enable the milestones app in tests to be consistent with it being enabled in production
FEATURES
[
'MILESTONES_APP'
]
=
True
# Need wiki for courseware views to work. TODO (vshnayder): shouldn't need it.
WIKI_ENABLED
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment