Skip to content

Commit 4d7cd70

Browse files
author
Renzo Lucioni
committed
Upgrade to DRF 3.4.7
DRF 3.4.7 is the same version run by edx/credentials. Release notes are at http://www.django-rest-framework.org/topics/release-notes/#34x-series. Highlights include: - [Support for Django 1.10](encode/django-rest-framework#4158) - sigh - [Support for schema generation](encode/django-rest-framework#4179) - required for newer versions of django-rest-swagger - A [change](encode/django-rest-framework#4201) that prevents paginated views from re-running queries when count queries return 0 - this explains the expected query count changes made in tests LEARNER-1590
1 parent accb325 commit 4d7cd70

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

course_discovery/apps/api/v1/tests/test_views/test_catalogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def test_courses(self):
185185
# Any course appearing in the response must have at least one serialized run.
186186
assert len(response.data['results'][0]['course_runs']) > 0
187187
else:
188-
with self.assertNumQueries(3):
188+
with self.assertNumQueries(2):
189189
response = self.client.get(url)
190190

191191
assert response.status_code == 200

course_discovery/apps/api/v1/tests/test_views/test_organizations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_list_tag_filter(self):
8585
organizations = OrganizationFactory.create_batch(2)
8686

8787
# If no organizations have been tagged, the endpoint should not return any data
88-
self.assert_list_tag_filter([], [tag], expected_query_count=4)
88+
self.assert_list_tag_filter([], [tag], expected_query_count=3)
8989

9090
# Tagged organizations should be returned
9191
organizations[0].tags.add(tag)

course_discovery/apps/api/v1/tests/test_views/test_programs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_filter_by_type(self):
170170
self.assert_list_results(url, [program], 8)
171171

172172
url = self.list_path + '?type=bar'
173-
self.assert_list_results(url, [], 4)
173+
self.assert_list_results(url, [], 3)
174174

175175
def test_filter_by_types(self):
176176
""" Verify that the endpoint filters programs to those matching the provided ProgramType slugs. """
@@ -197,7 +197,7 @@ def test_filter_by_uuids(self):
197197
self.assert_list_results(url, expected, 8)
198198

199199
@ddt.data(
200-
(ProgramStatus.Unpublished, False, 4),
200+
(ProgramStatus.Unpublished, False, 3),
201201
(ProgramStatus.Active, True, 8),
202202
)
203203
@ddt.unpack

course_discovery/apps/publisher/api/tests/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def test_update_course_key_with_duplicate(self):
262262

263263
self.assertEqual(response.status_code, 400)
264264
self.assertEqual(
265-
response.data.get('lms_course_id'), ['CourseRun with this lms course id already exists.']
265+
response.data.get('lms_course_id'), ['course run with this lms course id already exists.']
266266
)
267267

268268
def test_update_course_key(self):

requirements/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ django-taggit==0.22.1
2121
django-taggit-autosuggest==0.3.0
2222
django-taggit-serializer==0.1.5
2323
django-waffle==0.11.1
24-
djangorestframework==3.3.3
24+
djangorestframework==3.4.7
2525
djangorestframework-csv==1.4.1
2626
djangorestframework-jwt==1.8.0
2727
djangorestframework-xml==1.3.0

0 commit comments

Comments
 (0)