forked from hovel/pybbm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hovel#66 from hovel/travis_improvement
Travis ci improvement, django 1.3 full compatibility
- Loading branch information
Showing
15 changed files
with
162 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
# https://github.com/travis-ci/travis-ci/wiki/.travis.yml-options | ||
|
||
install: "sudo pip install -r test/example_thirdparty/requirements.txt -r test/example_thirdparty/requirements_test.txt" | ||
|
||
script: "python test/example_thirdparty/manage.py test pybb" | ||
|
||
language: python | ||
python: | ||
- "2.6" | ||
- "2.7" | ||
env: | ||
- DJANGO=1.3.7 | ||
- DJANGO=1.4.5 | ||
- DJANGO=1.5 | ||
install: | ||
- pip install Django==$DJANGO --use-mirrors | ||
- pip install -r test/test_project/requirements_test.txt | ||
script: | ||
- python setup.py test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/usr/bin/env python | ||
import sys | ||
import os | ||
from os.path import dirname, abspath | ||
from optparse import OptionParser | ||
|
||
from django.conf import settings | ||
import django | ||
|
||
TEMPLATE_CONTEXT_PROCESSORS = ( | ||
'django.contrib.auth.context_processors.auth', | ||
'django.core.context_processors.debug', | ||
'django.core.context_processors.i18n', | ||
'django.core.context_processors.media', | ||
'django.core.context_processors.static', | ||
'django.core.context_processors.request', | ||
'pybb.context_processors.processor', | ||
) | ||
|
||
if django.get_version() >= (1, 4): | ||
TEMPLATE_CONTEXT_PROCESSORS += ['django.core.context_processors.tz',] | ||
|
||
# For convenience configure settings if they are not pre-configured or if we | ||
# haven't been provided settings to use by environment variable. | ||
if not settings.configured and not os.environ.get('DJANGO_SETTINGS_MODULE'): | ||
settings.configure( | ||
DATABASES={ | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
} | ||
}, | ||
INSTALLED_APPS=[ | ||
'django.contrib.auth', | ||
'django.contrib.admin', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.sites', | ||
'pytils', | ||
'sorl.thumbnail', | ||
'pure_pagination', | ||
'pybb', | ||
], | ||
ROOT_URLCONF='test.test_project.test_urls', | ||
DEBUG=False, | ||
SITE_ID=1, | ||
STATIC_URL='/static/', | ||
AUTH_PROFILE_MODULE='pybb.Profile', | ||
TEMPLATE_DIRS=(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'test/test_project/templates'), ), | ||
PYBB_ATTACHMENT_ENABLE=True, | ||
TEMPLATE_CONTEXT_PROCESSORS=TEMPLATE_CONTEXT_PROCESSORS, | ||
) | ||
|
||
from django.test.simple import DjangoTestSuiteRunner | ||
|
||
|
||
def runtests(*test_args, **kwargs): | ||
if 'south' in settings.INSTALLED_APPS: | ||
from south.management.commands import patch_for_test_db_setup | ||
patch_for_test_db_setup() | ||
|
||
if not test_args: | ||
test_args = ['pybb'] | ||
parent = dirname(abspath(__file__)) | ||
sys.path.insert(0, parent) | ||
test_runner = DjangoTestSuiteRunner(verbosity=kwargs.get('verbosity', 1), interactive=kwargs.get('interactive', False), failfast=kwargs.get('failfast')) | ||
failures = test_runner.run_tests(test_args) | ||
sys.exit(failures) | ||
|
||
if __name__ == '__main__': | ||
parser = OptionParser() | ||
parser.add_option('--failfast', action='store_true', default=False, dest='failfast') | ||
|
||
(options, args) = parser.parse_args() | ||
|
||
runtests(failfast=options.failfast, *args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Django>=1.4 | ||
South>=0.7.5 | ||
Markdown>=2.1 | ||
postmarkup>=1.2.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% load url from future %} | ||
{% load pytils_numeral %} | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
{% block extra_style %}{% endblock %} | ||
<title>{% block title %}{% endblock %}</title> | ||
{% block extra_head %}{% endblock %} | ||
{% block extra_script %}{% endblock %} | ||
</head> | ||
<body> | ||
{% block breadcrumb %} | ||
{% endblock breadcrumb %} | ||
{% block content %} | ||
{% endblock content %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- coding: utf-8 -*- | ||
try: | ||
from django.conf.urls import patterns, include, url | ||
except ImportError: | ||
from django.conf.urls.defaults import patterns, include, url | ||
from django.contrib import admin | ||
|
||
admin.autodiscover() | ||
|
||
urlpatterns = patterns('', | ||
url(r'^admin/', include(admin.site.urls)), | ||
|
||
# TODO: we have to break such dependencies in application | ||
url(r"^accounts/password/$", 'django.contrib.auth.views.password_change', name="auth_password_change"), | ||
url(r"^accounts/signup/$", 'django.contrib.auth.views.login', name="registration_register", kwargs={'template_name': 'base.html'}), | ||
url(r"^accounts/login/$", 'django.contrib.auth.views.login', name="auth_login", kwargs={'template_name': 'base.html'}), | ||
|
||
url(r'^', include('pybb.urls', namespace='pybb')), | ||
) |