language: python

# Python versions to test
python:
  - "2.7"
  - "3.3"
  - "3.4"

# Manually define here the combinations of django and db versions to test
env:
  - DJANGO_VERSION=1.6.6 DB=postgresql
  - DJANGO_VERSION=1.6.6 DB=sqlite

# Install the application
install:
  - sh -c "if [ '$DB' = 'postgresql' ]; then pip install psycopg2; fi"
  
  - pip install -r requirements_devel.txt
  - pip install -q Django==$DJANGO_VERSION
  - pip install --upgrade django-tastypie
  - python extras/scripts/create_local_settings.py

# Create test databases
before_script:
  - sh -c "if [ '$DB' = 'postgresql' ]; then psql -c 'DROP DATABASE IF EXISTS test_wger;' -U postgres; fi"
  - sh -c "if [ '$DB' = 'postgresql' ]; then psql -c 'CREATE DATABASE test_wger;' -U postgres; fi"

# Do the tests
script:

  # Regular application
  - coverage run --source='.' ./manage.py test

  # Mobile version
  - TEST_MOBILE=True ./manage.py test

  # Formatting
  - pep8 --max-line-length=100 --exclude="urls.py,*migrations*" wger

  # Code coverage
  - coverage report

language: python

# Python versions to test
python:
  - "2.7"
  - "3.3"
  - "3.4"

# Manually define here the combinations of django and db versions to test
env:
  - DJANGO_VERSION=1.6.8 DB=postgresql
  - DJANGO_VERSION=1.6.8 DB=sqlite

# Install the application
install:
  - sh -c "if [ '$DB' = 'postgresql' ]; then pip install psycopg2; fi"
  
  - pip install -r requirements_devel.txt
  - pip install -q Django==$DJANGO_VERSION
  - pip install --upgrade django-tastypie
  - python extras/scripts/create_local_settings.py

# Create test databases
before_script:
  - sh -c "if [ '$DB' = 'postgresql' ]; then psql -c 'DROP DATABASE IF EXISTS test_wger;' -U postgres; fi"
  - sh -c "if [ '$DB' = 'postgresql' ]; then psql -c 'CREATE DATABASE test_wger;' -U postgres; fi"

# Do the tests
script:

  # Regular application
  - coverage run --source='.' ./manage.py test

  # Mobile version
  - TEST_MOBILE=True ./manage.py test

  # Formatting
  - pep8 --max-line-length=100 --exclude="urls.py,*migrations*" wger

  # Code coverage
  - coverage report

Update django version used for tests
Update django version used for tests
