Closed Bug 1231831 Opened 9 years ago Closed 9 years ago

Upgrade django-rest-framework to v3.3.1 and fix UnsupportedMediaType exceptions during tests

Categories

(Tree Management :: Treeherder, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

Details

Attachments

(1 file)

Upgrading django-rest-framework to v3.3.x results in some test failures, with: UnsupportedMediaType: Unsupported media type "multipart/form-data; boundary=BoUnDaRyStRiNg; charset=utf-8" in request.
Summary: Upgrade django-rest-framwork to v3.3.1 and fix UnsupportedMediaType exceptions during tests → Upgrade django-rest-framework to v3.3.1 and fix UnsupportedMediaType exceptions during tests
I had both commits locally already; the tests now pass :-)
Attachment #8697412 - Flags: review?(wlachance)
Commits pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/99ce2bca16294fdc273413d10a369783196f0c0f Bug 1231831 - Make django-rest-framework test requests use content_type json The default format used to make test requests is `multipart/form-data`, unless overridden using `TEST_REQUEST_DEFAULT_FORMAT`: http://www.django-rest-framework.org/api-guide/testing/#setting-the-default-format Our API only accepts json and html (see `DEFAULT_RENDERER_CLASSES`), so we should have always been setting `TEST_REQUEST_DEFAULT_FORMAT` to `json`, to prevent test failures. However until recently there was a bug preventing those failures: https://github.com/tomchristie/django-rest-framework/pull/3214 Which has now been fixed in django-rest-framwork v3.3.x: https://github.com/tomchristie/django-rest-framework/pull/3410 ...so we must fix this before updating to the latest version of d-r-f. https://github.com/mozilla/treeherder/commit/ed82dcc95a959518b247aa35387ef0095be62ecc Bug 1231831 - Update djangorestframework from v3.2.4 to v3.3.1 http://www.django-rest-framework.org/topics/release-notes/ https://github.com/tomchristie/django-rest-framework/compare/3.2.4...3.3.1 https://github.com/mozilla/treeherder/commit/a5edf7079b34ef5aa78d2f4029595f050c6f9a1a Merge pull request #1199 from mozilla/djangorestframework-331 Bug 1231831 - Upgrade django-rest-framework to v3.3.1 and fix test failures
Comment on attachment 8697412 [details] [review] Upgrade django-rest-framework to v3.3.1 and fix test failures Excellent, ty!
Attachment #8697412 - Flags: review?(wlachance) → review+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: