Skip to content

Commit

Permalink
Test Django 1.10
Browse files Browse the repository at this point in the history
Also includes:
* Change AnymailTestMixin.assertDoesNotWarn
  to filter specific warning classes.
* Look specifically for AnymailInsecureWebhookWarning
  in WebhookBasicAuthTestsMixin.test_warns_if_no_auth
  (because we don't care *in that test case* about
  DeprecatedInDjango10 warnings).
  • Loading branch information
medmunds committed May 30, 2016
1 parent 995617a commit 296f6ca
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
17 changes: 2 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ sudo: false
language: python
matrix:
include:
## Django 1.4: Python 2.6--2.7 (but Anymail doesn't support 2.6)
#- { env: DJANGO=django==1.4, python: 2.7 }
## Django 1.5: Python 2.7, pypy
#- { env: DJANGO=django==1.5, python: 2.7 }
#- { env: DJANGO=django==1.5, python: pypy }
## Django 1.6: Python 2.7--3.3, pypy
#- { env: DJANGO=django==1.6, python: 2.7 }
#- { env: DJANGO=django==1.6, python: 3.3 }
#- { env: DJANGO=django==1.6, python: pypy }
## Django 1.7: Python 2.7--3.4, pypy
#- { env: DJANGO=django==1.7, python: 2.7 }
#- { env: DJANGO=django==1.7, python: 3.3 }
#- { env: DJANGO=django==1.7, python: 3.4 }
#- { env: DJANGO=django==1.7, python: pypy }
# Django 1.8: "Python 2.7 or above"
- { env: DJANGO=django==1.8, python: 2.7 }
- { env: DJANGO=django==1.8, python: 3.4 }
Expand All @@ -26,7 +12,8 @@ matrix:
- { env: DJANGO=django==1.9, python: 3.5 }
- { env: DJANGO=django==1.9, python: pypy }
# Django 1.10 (prerelease)
#- { env: DJANGO="--pre django", python: 3.5 }
- { env: DJANGO="--pre django", python: 2.7 }
- { env: DJANGO="--pre django", python: 3.5 }
cache:
directories:
- $HOME/.cache/pip
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Support is also planned for:

* Normalized inbound email processing through your ESP

Anymail is released under the BSD license. It is extensively tested against Django 1.8--1.9
Anymail is released under the BSD license. It is extensively tested against Django 1.8--1.10
(including Python 2.7, Python 3 and PyPy).
Anymail releases follow `semantic versioning <http://semver.org/>`_.

Expand Down
10 changes: 8 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,15 @@ def assertWarnsRegex(self, expected_warning, expected_regex, msg=None):
return _AssertWarnsContext(expected_warning, self, expected_regex=expected_regex, msg=msg)

@contextmanager
def assertDoesNotWarn(self):
def assertDoesNotWarn(self, disallowed_warning=Warning):
"""Makes test error (rather than fail) if disallowed_warning occurs.
Note: you probably want to be more specific than the default
disallowed_warning=Warning, which errors for any warning
(including DeprecationWarnings).
"""
try:
warnings.simplefilter("error")
warnings.simplefilter("error", disallowed_warning)
yield
finally:
warnings.resetwarnings()
Expand Down
2 changes: 1 addition & 1 deletion tests/webhook_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_warns_if_no_auth(self):
with self.assertWarns(AnymailInsecureWebhookWarning):
response = self.call_webhook()
else:
with self.assertDoesNotWarn():
with self.assertDoesNotWarn(AnymailInsecureWebhookWarning):
response = self.call_webhook()
self.assertEqual(response.status_code, 200)

Expand Down

0 comments on commit 296f6ca

Please sign in to comment.