Skip to content

Commit

Permalink
Adding test for */* media type.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeyes committed Mar 6, 2016
1 parent ae09a8a commit 863ed68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ source = methodview

[report]
omit =
tests/*
*/python?.?/*
*/site-packages/nose/*
13 changes: 13 additions & 0 deletions tests/unit/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def get_application_json(self, request):
"""Return 'GOT APPLICATION JSON'."""
return 'GOT APPLICATION JSON'

def put_whatever(self, request):
"""Return 'PUT WHATEVER'."""
return 'PUT WHATEVER'

def test(self):
"""Test `Accept` header."""
view = AcceptHeaderTest.TestView()
Expand All @@ -84,6 +88,15 @@ def test(self):
res = view(request)
self.assertEqual('GOT APPLICATION JSON', res)

def test_any_media(self):
"""Test */* media."""
view = AcceptHeaderTest.TestView()

request = create_request('PUT')
request.META['HTTP_ACCEPT'] = '*/*'
res = view(request)
self.assertEqual('PUT WHATEVER', res)


class AuthorizeTest(TestCase):
"""Test for honouring `Accept` header."""
Expand Down

0 comments on commit 863ed68

Please sign in to comment.