From 385d76b53acfe746090c5d271c1e8fd6c34a396a Mon Sep 17 00:00:00 2001 From: medmunds Date: Mon, 21 Mar 2016 11:38:58 -0700 Subject: [PATCH] Move tests out of app module (Directory structure as suggested in [Django testing docs][1].) [1]: https://docs.djangoproject.com/en/1.9/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications --- MANIFEST.in | 1 - docs/contributing.rst | 2 +- runtests.py | 2 +- {anymail/tests => tests}/__init__.py | 0 {anymail/tests => tests}/mock_requests_backend.py | 0 {anymail/tests => tests}/sample_image.png | Bin {anymail/tests => tests}/test_mailgun_backend.py | 0 .../tests => tests}/test_mailgun_integration.py | 0 {anymail/tests => tests}/test_mandrill_backend.py | 0 .../test_mandrill_djrill_features.py | 0 .../tests => tests}/test_mandrill_integration.py | 0 {anymail/tests => tests}/test_mandrill_webhook.py | 0 {anymail/tests => tests}/test_postmark_backend.py | 0 .../tests => tests}/test_postmark_integration.py | 0 {anymail/tests => tests}/test_sendgrid_backend.py | 0 .../tests => tests}/test_sendgrid_integration.py | 0 {anymail/tests => tests}/utils.py | 0 17 files changed, 2 insertions(+), 3 deletions(-) rename {anymail/tests => tests}/__init__.py (100%) rename {anymail/tests => tests}/mock_requests_backend.py (100%) rename {anymail/tests => tests}/sample_image.png (100%) rename {anymail/tests => tests}/test_mailgun_backend.py (100%) rename {anymail/tests => tests}/test_mailgun_integration.py (100%) rename {anymail/tests => tests}/test_mandrill_backend.py (100%) rename {anymail/tests => tests}/test_mandrill_djrill_features.py (100%) rename {anymail/tests => tests}/test_mandrill_integration.py (100%) rename {anymail/tests => tests}/test_mandrill_webhook.py (100%) rename {anymail/tests => tests}/test_postmark_backend.py (100%) rename {anymail/tests => tests}/test_postmark_integration.py (100%) rename {anymail/tests => tests}/test_sendgrid_backend.py (100%) rename {anymail/tests => tests}/test_sendgrid_integration.py (100%) rename {anymail/tests => tests}/utils.py (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 085afd7..cbcb0ed 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,2 @@ include README.rst AUTHORS.txt LICENSE recursive-include anymail *.py -prune anymail/tests diff --git a/docs/contributing.rst b/docs/contributing.rst index 59eb13a..1371071 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -78,6 +78,6 @@ get from from environment variables. Look in the ``*_integration_tests.py`` files in the `tests source`_ for specific requirements. .. _.travis.yml: https://github.com/anymail/django-anymail/blob/master/.travis.yml -.. _tests source: https://github.com/anymail/django-anymail/blob/master/anymail/tests +.. _tests source: https://github.com/anymail/django-anymail/blob/master/tests .. _mock: http://www.voidspace.org.uk/python/mock/index.html .. _tested on Travis: https://travis-ci.org/anymail/django-anymail diff --git a/runtests.py b/runtests.py index 98b8f77..6d6f50a 100644 --- a/runtests.py +++ b/runtests.py @@ -52,7 +52,7 @@ except ImportError: def runtests(*args): test_runner = TestRunner(verbosity=1) - test_labels = args if len(args) > 0 else [APP] + test_labels = args if len(args) > 0 else ['tests'] failures = test_runner.run_tests(test_labels) sys.exit(failures) diff --git a/anymail/tests/__init__.py b/tests/__init__.py similarity index 100% rename from anymail/tests/__init__.py rename to tests/__init__.py diff --git a/anymail/tests/mock_requests_backend.py b/tests/mock_requests_backend.py similarity index 100% rename from anymail/tests/mock_requests_backend.py rename to tests/mock_requests_backend.py diff --git a/anymail/tests/sample_image.png b/tests/sample_image.png similarity index 100% rename from anymail/tests/sample_image.png rename to tests/sample_image.png diff --git a/anymail/tests/test_mailgun_backend.py b/tests/test_mailgun_backend.py similarity index 100% rename from anymail/tests/test_mailgun_backend.py rename to tests/test_mailgun_backend.py diff --git a/anymail/tests/test_mailgun_integration.py b/tests/test_mailgun_integration.py similarity index 100% rename from anymail/tests/test_mailgun_integration.py rename to tests/test_mailgun_integration.py diff --git a/anymail/tests/test_mandrill_backend.py b/tests/test_mandrill_backend.py similarity index 100% rename from anymail/tests/test_mandrill_backend.py rename to tests/test_mandrill_backend.py diff --git a/anymail/tests/test_mandrill_djrill_features.py b/tests/test_mandrill_djrill_features.py similarity index 100% rename from anymail/tests/test_mandrill_djrill_features.py rename to tests/test_mandrill_djrill_features.py diff --git a/anymail/tests/test_mandrill_integration.py b/tests/test_mandrill_integration.py similarity index 100% rename from anymail/tests/test_mandrill_integration.py rename to tests/test_mandrill_integration.py diff --git a/anymail/tests/test_mandrill_webhook.py b/tests/test_mandrill_webhook.py similarity index 100% rename from anymail/tests/test_mandrill_webhook.py rename to tests/test_mandrill_webhook.py diff --git a/anymail/tests/test_postmark_backend.py b/tests/test_postmark_backend.py similarity index 100% rename from anymail/tests/test_postmark_backend.py rename to tests/test_postmark_backend.py diff --git a/anymail/tests/test_postmark_integration.py b/tests/test_postmark_integration.py similarity index 100% rename from anymail/tests/test_postmark_integration.py rename to tests/test_postmark_integration.py diff --git a/anymail/tests/test_sendgrid_backend.py b/tests/test_sendgrid_backend.py similarity index 100% rename from anymail/tests/test_sendgrid_backend.py rename to tests/test_sendgrid_backend.py diff --git a/anymail/tests/test_sendgrid_integration.py b/tests/test_sendgrid_integration.py similarity index 100% rename from anymail/tests/test_sendgrid_integration.py rename to tests/test_sendgrid_integration.py diff --git a/anymail/tests/utils.py b/tests/utils.py similarity index 100% rename from anymail/tests/utils.py rename to tests/utils.py