MA-862; accept application/merge-patch+json for comment/thread update

This commit is contained in:
wajeeha-khalid
2015-11-10 18:28:16 +05:00
parent 685572cbee
commit 4ea70aeb19
3 changed files with 45 additions and 7 deletions

View File

@@ -1,3 +1,8 @@
"""
Utility Mixins for unit tests
"""
import json
import sys
from mock import patch
@@ -90,3 +95,16 @@ class EventTestMixin(object):
Reset the mock tracker in order to forget about old events.
"""
self.mock_tracker.reset_mock()
class PatchMediaTypeMixin(object):
"""
Generic mixin for verifying unsupported media type in PATCH
"""
def test_patch_unsupported_media_type(self):
response = self.client.patch( # pylint: disable=no-member
self.url,
json.dumps({}),
content_type=self.unsupported_media_type
)
self.assertEqual(response.status_code, 415)