Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: f763c97fcf
Fetching contributors…

Cannot retrieve contributors at this time

executable file 70 lines (57 sloc) 1.93 kb
#!/usr/bin/env python
import os
import sys
import unittest
from micawber import tests
def run_django_tests():
try:
import django
except ImportError:
print 'Skipping django tests'
return failures, errors
else:
print 'Running django integration tests'
providers = 'micawber.contrib.mcdjango.mcdjango_tests.tests.test_pr'
extensions = (
('oembed_no_urlize', {'urlize_all': False}),
)
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASE_ENGINE='sqlite3',
SITE_ID=1,
INSTALLED_APPS=[
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'micawber.contrib.mcdjango',
'micawber.contrib.mcdjango.mcdjango_tests',
],
MICAWBER_PROVIDERS=providers,
MICAWBER_TEMPLATE_EXTENSIONS=extensions,
)
else:
settings.MICAWBER_PROVIDERS = providers
settings.MICAWBER_TEMPLATE_EXTENSIONS = extensions
from django.test.simple import run_tests
parent = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, parent)
return run_tests(['mcdjango_tests'], verbosity=1, interactive=True)
def runtests(*test_args):
print "Running micawber tests"
errors = failures = False
suite = unittest.TestLoader().loadTestsFromModule(tests)
result = unittest.TextTestRunner(verbosity=2).run(suite)
if result.failures:
failures = True
if result.errors:
errors = True
if not (errors or failures):
print "All micawber tests passed"
dj_failures = run_django_tests()
if failures or errors or dj_failures:
sys.exit(1)
sys.exit(0)
if __name__ == '__main__':
runtests(*sys.argv[1:])
Jump to Line
Something went wrong with that request. Please try again.