mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Cherry-picked from: 8c26807a - Add runtests.py for testing separately from other Django apps cd8504b1 - Make tests compatible with setuptools 4ac65b78 - Set up testing on the backend API calls, using mock
36 lines
698 B
Python
36 lines
698 B
Python
# python setup.py test
|
|
# or
|
|
# python runtests.py
|
|
|
|
import sys
|
|
from django.conf import settings
|
|
|
|
APP='djrill'
|
|
|
|
settings.configure(
|
|
DEBUG=True,
|
|
DATABASES={
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
}
|
|
},
|
|
ROOT_URLCONF=APP+'.urls',
|
|
INSTALLED_APPS=(
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.admin',
|
|
APP,
|
|
)
|
|
)
|
|
|
|
from django.test.simple import DjangoTestSuiteRunner
|
|
|
|
def runtests():
|
|
test_runner = DjangoTestSuiteRunner(verbosity=1)
|
|
failures = test_runner.run_tests([APP, ])
|
|
sys.exit(failures)
|
|
|
|
if __name__ == '__main__':
|
|
runtests()
|