diff --git a/openedx/tests/completion_integration/test_views.py b/openedx/tests/completion_integration/test_views.py index f8b27d9f2b574c9ac646c4ac5e1de05185e969d1..f9edcdb2fb0eead8f2fd4538c6c5540950c25512 100644 --- a/openedx/tests/completion_integration/test_views.py +++ b/openedx/tests/completion_integration/test_views.py @@ -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 diff --git a/requirements/edx-sandbox/base.txt b/requirements/edx-sandbox/base.txt index 3a24105d110c0305a7ea452ebbb44f660a392325..095e5f34a5d5295c5ed1bee5a1ff431e726d86b3 100644 --- a/requirements/edx-sandbox/base.txt +++ b/requirements/edx-sandbox/base.txt @@ -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 diff --git a/requirements/edx-sandbox/shared.txt b/requirements/edx-sandbox/shared.txt index 36f98d7d553df5de8324acb74230d426120ed3a4..349288916e16f218d16b644726c98be255224c87 100644 --- a/requirements/edx-sandbox/shared.txt +++ b/requirements/edx-sandbox/shared.txt @@ -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 diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index b2439bea0eecbd42ec2285bd58dd665e6c25870e..7b3ca62bc751965637a62ac63a05af84b0a2e86b 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -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 diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 19677829ec0d833c2c6c63607b2daa97c3469e6d..fb9db4508d3deb924ad053f17ea634ef7da27a1b 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -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 diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index e784caf6c22e81994d99f84d798dbf5f061ca91d..229a57c889358f5e4e5220e09637737cea852027 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -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