Skip to content
Snippets Groups Projects
Unverified Commit 0f29ca26 authored by Nimisha Asthagiri's avatar Nimisha Asthagiri Committed by GitHub
Browse files

Merge pull request #17968 from edx/arch/remove-course-structure-usage-in-completion

Remove Completion's usage of Course Structures API
parents a9693f4a fd078ae1
No related merge requests found
......@@ -11,7 +11,6 @@ from rest_framework.test import APIClient
from student.tests.factories import UserFactory, CourseEnrollmentFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from openedx.core.djangoapps.content.course_structures.tasks import update_course_structure
from openedx.core.djangolib.testing.utils import skip_unless_lms
......@@ -44,7 +43,6 @@ class CompletionBatchTestCase(CompletionWaffleTestMixin, ModuleStoreTestCase):
category="problem",
display_name="Test Problem",
)
update_course_structure(unicode(self.course.id))
# Create users
self.staff_user = UserFactory(is_staff=True)
......@@ -99,15 +97,31 @@ class CompletionBatchTestCase(CompletionWaffleTestMixin, ModuleStoreTestCase):
}
}, 400, {"detail": "Invalid course key: not:a:course:key"}
),
# Block must be a valid key
(
{
'username': ENROLLED_USERNAME,
'course_key': COURSE_KEY,
'blocks': {
'not:a:block:key': 1.0,
}
}, 400, {"detail": "Invalid block key: not:a:block:key"}
),
# Block not in course
(
{
'username': ENROLLED_USERNAME,
'course_key': COURSE_KEY,
'blocks': {
'some:other:block': 1.0,
'i4x://some/other_course/problem/Test_Problem': 1.0,
}
}, 400, {"detail": "Block with key: 'some:other:block' is not in course {}".format(COURSE_KEY)}
},
400,
{
"detail": "Block with key: 'i4x://some/other_course/problem/Test_Problem' is not in course {}".format(
COURSE_KEY,
)
}
),
# Course key is required
(
......@@ -152,7 +166,7 @@ class CompletionBatchTestCase(CompletionWaffleTestMixin, ModuleStoreTestCase):
'blocks': {
BLOCK_KEY: 1.0,
}
}, 404, {"detail": "CourseStructure matching query does not exist."}
}, 400, {"detail": "User is not enrolled in course."}
),
)
@ddt.unpack
......
......@@ -16,7 +16,7 @@ cryptography==2.1.4
enum34==1.1.6
futures==3.2.0 # via tornado
idna==2.6
ipaddress==1.0.19
ipaddress==1.0.22
lxml==3.8.0
matplotlib==1.3.1
networkx==1.7
......
......@@ -14,7 +14,7 @@ cffi==1.11.5 # via cryptography
cryptography==2.1.4
enum34==1.1.6 # via cryptography
idna==2.6 # via cryptography
ipaddress==1.0.19 # via cryptography
ipaddress==1.0.22 # via cryptography
lxml==3.8.0
networkx==1.7
nltk==3.2.5
......
......@@ -72,7 +72,7 @@ cryptography==2.1.4
cssselect==0.9.1
cssutils==1.0.2 # via pynliner
ddt==0.8.0
decorator==4.2.1 # via dogapi, pycontracts
decorator==4.3.0 # via dogapi, pycontracts
defusedxml==0.4.1
dicttoxml==1.7.4 # via moto
django-appconf==1.0.2 # via django-statici18n
......@@ -121,7 +121,7 @@ edx-ace==0.1.6
edx-analytics-data-api-client==0.14.4
edx-ccx-keys==0.2.1
edx-celeryutils==0.2.7
edx-completion==0.1.5
edx-completion==0.1.6
edx-django-oauth2-provider==1.2.5
edx-django-release-util==0.3.1
edx-django-sites-extensions==2.3.1
......@@ -166,7 +166,7 @@ httplib2==0.11.3 # via oauth2, zendesk
httpretty==0.8.14
idna==2.6
ipaddr==2.1.11
ipaddress==1.0.19
ipaddress==1.0.22
isodate==0.6.0 # via python-saml
itsdangerous==0.24 # via flask
jinja2==2.10 # via flask, moto, sphinx
......
......@@ -80,7 +80,7 @@ cryptography==2.1.4
cssselect==0.9.1
cssutils==1.0.2
ddt==0.8.0
decorator==4.2.1
decorator==4.3.0
defusedxml==0.4.1
dicttoxml==1.7.4
diff-cover==0.9.8
......@@ -130,7 +130,7 @@ edx-ace==0.1.6
edx-analytics-data-api-client==0.14.4
edx-ccx-keys==0.2.1
edx-celeryutils==0.2.7
edx-completion==0.1.5
edx-completion==0.1.6
edx-django-oauth2-provider==1.2.5
edx-django-release-util==0.3.1
edx-django-sites-extensions==2.3.1
......@@ -180,7 +180,7 @@ idna==2.6
incremental==17.5.0
inflect==0.2.5
ipaddr==2.1.11
ipaddress==1.0.19
ipaddress==1.0.22
isodate==0.6.0
isort==4.2.5
itsdangerous==0.24
......@@ -313,7 +313,7 @@ sympy==0.7.1
testfixtures==4.5.0
testtools==0.9.34
text-unidecode==1.2
tox-battery==0.5
tox-battery==0.5.1
tox==2.8.2
transifex-client==0.12.1
twisted==16.6.0
......
......@@ -79,7 +79,7 @@ cryptography==2.1.4
cssselect==0.9.1
cssutils==1.0.2
ddt==0.8.0
decorator==4.2.1
decorator==4.3.0
defusedxml==0.4.1
dicttoxml==1.7.4
diff-cover==0.9.8
......@@ -128,7 +128,7 @@ edx-ace==0.1.6
edx-analytics-data-api-client==0.14.4
edx-ccx-keys==0.2.1
edx-celeryutils==0.2.7
edx-completion==0.1.5
edx-completion==0.1.6
edx-django-oauth2-provider==1.2.5
edx-django-release-util==0.3.1
edx-django-sites-extensions==2.3.1
......@@ -177,7 +177,7 @@ idna==2.6
incremental==17.5.0 # via twisted
inflect==0.2.5
ipaddr==2.1.11
ipaddress==1.0.19
ipaddress==1.0.22
isodate==0.6.0
isort==4.2.5
itsdangerous==0.24
......@@ -308,7 +308,7 @@ sympy==0.7.1
testfixtures==4.5.0
testtools==0.9.34
text-unidecode==1.2
tox-battery==0.5
tox-battery==0.5.1
tox==2.8.2
transifex-client==0.12.1
twisted==16.6.0 # via pa11ycrawler, scrapy
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment