mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Test Django 1.10
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).
This commit is contained in:
17
.travis.yml
17
.travis.yml
@@ -2,20 +2,6 @@ sudo: false
|
|||||||
language: python
|
language: python
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
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"
|
# Django 1.8: "Python 2.7 or above"
|
||||||
- { env: DJANGO=django==1.8, python: 2.7 }
|
- { env: DJANGO=django==1.8, python: 2.7 }
|
||||||
- { env: DJANGO=django==1.8, python: 3.4 }
|
- { env: DJANGO=django==1.8, python: 3.4 }
|
||||||
@@ -26,7 +12,8 @@ matrix:
|
|||||||
- { env: DJANGO=django==1.9, python: 3.5 }
|
- { env: DJANGO=django==1.9, python: 3.5 }
|
||||||
- { env: DJANGO=django==1.9, python: pypy }
|
- { env: DJANGO=django==1.9, python: pypy }
|
||||||
# Django 1.10 (prerelease)
|
# 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:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.cache/pip
|
- $HOME/.cache/pip
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Support is also planned for:
|
|||||||
|
|
||||||
* Normalized inbound email processing through your ESP
|
* 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).
|
(including Python 2.7, Python 3 and PyPy).
|
||||||
Anymail releases follow `semantic versioning <http://semver.org/>`_.
|
Anymail releases follow `semantic versioning <http://semver.org/>`_.
|
||||||
|
|
||||||
|
|||||||
@@ -51,9 +51,15 @@ class AnymailTestMixin:
|
|||||||
return _AssertWarnsContext(expected_warning, self, expected_regex=expected_regex, msg=msg)
|
return _AssertWarnsContext(expected_warning, self, expected_regex=expected_regex, msg=msg)
|
||||||
|
|
||||||
@contextmanager
|
@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:
|
try:
|
||||||
warnings.simplefilter("error")
|
warnings.simplefilter("error", disallowed_warning)
|
||||||
yield
|
yield
|
||||||
finally:
|
finally:
|
||||||
warnings.resetwarnings()
|
warnings.resetwarnings()
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class WebhookBasicAuthTestsMixin(object):
|
|||||||
with self.assertWarns(AnymailInsecureWebhookWarning):
|
with self.assertWarns(AnymailInsecureWebhookWarning):
|
||||||
response = self.call_webhook()
|
response = self.call_webhook()
|
||||||
else:
|
else:
|
||||||
with self.assertDoesNotWarn():
|
with self.assertDoesNotWarn(AnymailInsecureWebhookWarning):
|
||||||
response = self.call_webhook()
|
response = self.call_webhook()
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user