Skip to content

Commit

Permalink
Add POSTGIS_VERSION again
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhitlock committed Aug 22, 2014
1 parent ab1fdda commit f583a56
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ before_script:

script: tox
env:
- TOXENV=py26 DATABASE_URL="postgis://postgres@/bpzaroundme"
- TOXENV=py27 DATABASE_URL="postgis://postgres@/bpzaroundme"
- TOXENV=py33 DATABASE_URL="postgis://postgres@/bpzaroundme"
- TOXENV=py34 DATABASE_URL="postgis://postgres@/bpzaroundme"
- TOXENV=py26 DATABASE_URL="postgis://postgres@/bpzaroundme" POSTGIS_VERSION=2.1.3
- TOXENV=py27 DATABASE_URL="postgis://postgres@/bpzaroundme" POSTGIS_VERSION=2.1.3
- TOXENV=py33 DATABASE_URL="postgis://postgres@/bpzaroundme" POSTGIS_VERSION=2.1.3
- TOXENV=py34 DATABASE_URL="postgis://postgres@/bpzaroundme" POSTGIS_VERSION=2.1.3
- TOXENV=style
- TOXENV=docs

Expand Down
6 changes: 6 additions & 0 deletions bpzaroundme/settings/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from os import environ
from os.path import abspath, basename, dirname, join, normpath
from sys import path
import dj_database_url
Expand Down Expand Up @@ -163,3 +164,8 @@

# Use django-nose to run tests
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'

# Set POSTGIS_VERSION from environment
if environ.get('POSTGIS_VERSION'):
raw_postgis_version = environ['POSTGIS_VERSION']
POSTGIS_VERSION = tuple(int(x) for x in raw_postgis_version.split('.'))
10 changes: 9 additions & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
from __future__ import print_function

import sys
from os import environ

from django.conf import settings
import dj_database_url


def base_config():
'''Create a minimal Django configuration'''
return {
config = {
'INSTALLED_APPS': ['south', 'django_nose', 'bpz'],
'TEST_RUNNER': 'django_nose.NoseTestSuiteRunner',
'DATABASES': {
Expand All @@ -20,6 +21,13 @@ def base_config():
'TEMPLATE_DEBUG': True
}

if environ.get('POSTGIS_VERSION'):
raw_postgis_version = environ['POSTGIS_VERSION']
config['POSTGIS_VERSION'] = tuple(
int(x) for x in raw_postgis_version.split('.'))

return config


def test_config():
'''Create a Django configuration for running tests'''
Expand Down

0 comments on commit f583a56

Please sign in to comment.