зеркало из https://github.com/mozilla/batucada.git
Use django_nose for tests. Also, move importing of settings_local to manage.py
This commit is contained in:
Родитель
473560bc24
Коммит
b5b53e0711
14
manage.py
14
manage.py
|
@ -10,11 +10,17 @@ path = lambda *a: os.path.join(ROOT, *a)
|
|||
site.addsitedir(path('apps'))
|
||||
|
||||
try:
|
||||
import settings # Assumed to be in the same directory.
|
||||
import settings_local as settings
|
||||
except ImportError:
|
||||
import sys
|
||||
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
|
||||
sys.exit(1)
|
||||
try:
|
||||
import settings
|
||||
except ImportError:
|
||||
import sys
|
||||
sys.stderr.write(
|
||||
"Error: Tried importing 'settings_local.py' and 'settings.py' "
|
||||
"but neither could be found (or they're throwin an ImportError)."
|
||||
" Please come back and try later.")
|
||||
raise
|
||||
|
||||
if __name__ == "__main__":
|
||||
execute_manager(settings)
|
||||
|
|
|
@ -3,6 +3,7 @@ python-openid==2.2.5
|
|||
django-openid-auth==0.2
|
||||
pil
|
||||
|
||||
-e git://github.com/jbalogh/django-nose#egg=django-nose
|
||||
-e git://github.com/clouserw/tower.git#egg=tower
|
||||
-e git://github.com/paulosman/python-xrd#egg=xrd
|
||||
-e git://github.com/paulosman/django-wellknown.git#egg=wellknown
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
|
||||
import os
|
||||
|
||||
try:
|
||||
from settings_local import *
|
||||
except ImportError:
|
||||
print u'File settings_local.py is not found. Continuing with production settings.'
|
||||
|
||||
|
||||
# Make filepaths relative to settings.
|
||||
ROOT = os.path.dirname(os.path.abspath(__file__))
|
||||
path = lambda *a: os.path.join(ROOT, *a)
|
||||
|
@ -100,6 +94,7 @@ INSTALLED_APPS = (
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.admin',
|
||||
'django_nose',
|
||||
'django_openid_auth',
|
||||
'wellknown',
|
||||
'users',
|
||||
|
@ -112,6 +107,8 @@ INSTALLED_APPS = (
|
|||
'projects',
|
||||
)
|
||||
|
||||
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
|
||||
|
||||
WELLKNOWN_HOSTMETA_HOSTS = ('localhost:8000',)
|
||||
MOZILLA_AMCD_HREF = '/meta/amcd.json'
|
||||
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
{% if form.errors or error %}
|
||||
{% if form and form.errors %}
|
||||
<div class="errors">
|
||||
{% if form and form.errors %}
|
||||
<p>{{ _('The following errors were encountered') }}:</p>
|
||||
<ul>
|
||||
{% for error in form.errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
{% if error %}
|
||||
<p>{{ error }}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% for error in form.errors.values %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if error %}
|
||||
<div class="errors">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче