Revision history [back]
I managed to get a test run that seems more promising by modifying the manage.py
of the dummy project with the follow code after the import
sections:
import sys, os
if 'DJANGO_SETTINGS_MODULE' not in os.environ:
os.environ['DJANGO_SETTINGS_MODULE'] = 'dev.settings' # <-- name of my dummy project
if 'test' in sys.argv:
sys.path.append('.')
from dev import settings # <-- my dev project's settings module here
settings.LIVESETTINGS_OPTIONS = {
settings.SITE_ID: {'SETTINGS':
{'EXTERNAL_KEYS': {
'RECAPTCHA_SECRET': 'xxx'
}
}
}
}
from django.test.utils import setup_test_environment, teardown_test_environment
setup_test_environment()
if 'south' in settings.INSTALLED_APPS:
from south.management.commands import patch_for_test_db_setup
patch_for_test_db_setup()
from django.db import connection
connection.creation.create_test_db(1, True)
The test suites seems to be taking quite long time to run on my machine even with an sqlite3 :memory:
database, but I suppose that's to be expected. I'll let it run through when I get time. It does seem to throw occasional failures, though.
SOUTH
setup in test environments from my fork of django-pytest
.
I managed to get a test run that seems more promising by modifying the manage.py
of the dummy project with the follow code after the import
sections:
import sys, os
if 'DJANGO_SETTINGS_MODULE' not in os.environ:
os.environ['DJANGO_SETTINGS_MODULE'] = 'dev.settings' # <-- name of my dummy project
if 'test' in sys.argv:
sys.path.append('.')
from dev import settings # <-- my dev project's settings module here
settings.LIVESETTINGS_OPTIONS = {
settings.SITE_ID: {'SETTINGS':
{'EXTERNAL_KEYS': {
'RECAPTCHA_SECRET': 'xxx'
}
}
}
}
from django.test.utils import setup_test_environment, teardown_test_environment
setup_test_environment()
if 'south' in settings.INSTALLED_APPS:
from south.management.commands import patch_for_test_db_setup
patch_for_test_db_setup()
from django.db import connection
connection.creation.create_test_db(1, True)
The test suites seems to be taking quite long time to run on my machine even with an sqlite3 :memory:
database, but I suppose that's to be expected. I'll let it run through when I get time. It does seem to throw occasional failures, though.
SOUTH
setup in test environments from my fork of django-pytest
.