Skip to content

Commit

Permalink
Merge pull request #28 from edmorley/fix-travis
Browse files Browse the repository at this point in the history
Green up Travis tests on master after mohawk and django-nose changes
  • Loading branch information
kumar303 committed Jan 19, 2017
2 parents fc43e2e + d73222b commit 51f7dfb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ python: "3.5"
env:
- TOX_ENV=docs

- TOX_ENV=py27-django1.6-drf3.2
- TOX_ENV=py27-django1.7-drf3.2
- TOX_ENV=py27-django1.7-drf3.3
- TOX_ENV=py27-django1.8-drf3.2
- TOX_ENV=py27-django1.8-drf3.3
- TOX_ENV=py27-django1.9-drf3.3
Expand Down
6 changes: 5 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Installation
Requirements:

* Python 2.7+ or 3.4+
* `Django`_ 1.6 through 1.9
* `Django`_ 1.8 through 1.9
* `Django Rest Framework`_ 3.2 or 3.3
* `mohawk`_
(Older versions of these libraries may work, but support is not guaranteed.)
Expand Down Expand Up @@ -93,6 +93,10 @@ Changelog
use ``rest_framework.permissions.IsAuthenticated`` on your views
:ref:`as documented <protecting-api-views>`

- **Unreleased**

- Dropped support for Django 1.6/1.7.

- **0.0.10** (2016-06-01)

- Adds support for Django 1.9.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
'Topic :: Internet :: WWW/HTTP',
],
packages=find_packages(exclude=['tests']),
install_requires=['djangorestframework', 'mohawk>=0.3.0'])
install_requires=['djangorestframework', 'mohawk>=0.3.3'])
4 changes: 2 additions & 2 deletions tests/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def setUp(self):
def assert_log_regex(self, method, pattern):
log_call = getattr(self.mock_log, method).call_args[0][0]
assert re.search(pattern, log_call), (
'Unexpected call: log.{}("{}")'.format(method, log_call))
'Expected log.{}() matching "{}", saw: "{}"'.format(method, pattern, log_call))


class TestAuthentication(AuthTest):
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_hawk_post_wrong_sig(self):
self.assertRaisesRegexp(AuthenticationFailed,
'^Hawk authentication failed$',
lambda: self.auth.authenticate(req))
self.assert_log_regex('warning', '^access denied: MacMismatch: ')
self.assert_log_regex('warning', '^access denied: MisComputedContentHash: ')

def test_hawk_get_wrong_sig(self):
sender = self._sender(url='http://realsite.com')
Expand Down
6 changes: 3 additions & 3 deletions tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.http import HttpResponse

import mock
from mohawk.exc import MacMismatch
from mohawk.exc import MisComputedContentHash
from mohawk import Receiver

from hawkrest import lookup_credentials
Expand Down Expand Up @@ -57,7 +57,7 @@ def test_respond_with_bad_content(self):

response.content = 'TAMPERED WITH'

with self.assertRaises(MacMismatch):
with self.assertRaises(MisComputedContentHash):
self.accept_response(res, sender)

def test_respond_with_bad_content_type(self):
Expand All @@ -68,5 +68,5 @@ def test_respond_with_bad_content_type(self):

response['Content-Type'] = 'TAMPERED WITH'

with self.assertRaises(MacMismatch):
with self.assertRaises(MisComputedContentHash):
self.accept_response(res, sender)
4 changes: 0 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
# When updating the envlist, be sure to also update TOX_ENV in .travis.yml
envlist =
docs,
py27-django1.6-drf3.2,
py27-django1.7-drf{3.2,3.3},
{py27,py34,py35}-django1.8-drf{3.2,3.3}
# Django 1.9 requires DRF >= 3.3
{py27,py34,py35}-django1.9-drf3.3

[testenv]
commands = {envpython} runtests.py []
deps =
django1.6: Django>=1.6,<1.7
django1.7: Django>=1.7,<1.8
django1.8: Django>=1.8,<1.9
django1.9: Django>=1.9,<1.10
drf3.2: djangorestframework>=3.2,<3.3
Expand Down

0 comments on commit 51f7dfb

Please sign in to comment.