Skip to content

Commit

Permalink
Merge 9a5a2bc into fb96dee
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Jul 25, 2013
2 parents fb96dee + 9a5a2bc commit 59327dc
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 57 deletions.
23 changes: 13 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,34 @@ language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"

env:
- DJANGO=Django==1.4.5 SOUTH=1
- DJANGO=Django==1.5.1 SOUTH=1
- DJANGO=https://github.com/django/django/tarball/stable/1.6.x SOUTH=1
- DJANGO=https://github.com/django/django/tarball/master SOUTH=1
- DJANGO=Django==1.5.1 SOUTH=0

install:
- pip install $DJANGO --use-mirrors
- pip install coverage coveralls --use-mirrors
- sh -c "if [ '$SOUTH' = '1' ]; then pip install South==0.7.6; fi"
- pip install $DJANGO
- pip install coverage coveralls
- sh -c "if [ '$SOUTH' = '1' ]; then pip install South==0.8.1; fi"

script:
- coverage run -a setup.py test
- coverage report

matrix:
include:
- python: 3.2
env: DJANGO=Django==1.5.1 SOUTH=0
exclude:
- python: 2.6
env: DJANGO=https://github.com/django/django/tarball/master SOUTH=1
- python: 3.2
env: DJANGO=https://github.com/django/django/tarball/master SOUTH=0
env: DJANGO=Django==1.4.5 SOUTH=1
- python: 3.3
end: DJANGO=Django==1.4.5 SOUTH=1
include:
- python: 2.7
env: DJANGO=Django==1.5.1 SOUTH=0
- python: 3.3
env: DJANGO=https://github.com/django/django/tarball/master SOUTH=0

after_success: coveralls
43 changes: 23 additions & 20 deletions model_utils/tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from __future__ import unicode_literals
import pickle

from datetime import datetime, timedelta
import pickle
try:
from unittest import skipUnless
except ImportError: # Python 2.6
from django.utils.unittest import skipUnless

import django
from django.db import models
Expand Down Expand Up @@ -583,25 +587,24 @@ def test_ordering(self):
except ImportError:
introspector = None

# @@@ use skipUnless once Django 1.3 is minimum supported version
if introspector:
class SouthFreezingTests(TestCase):
def test_introspector_adds_no_excerpt_field(self):
mf = Article._meta.get_field('body')
args, kwargs = introspector(mf)
self.assertEqual(kwargs['no_excerpt_field'], 'True')


def test_no_excerpt_field_works(self):
from models import NoRendered
self.assertRaises(FieldDoesNotExist,
NoRendered._meta.get_field,
'_body_excerpt')

def test_status_field_no_check_for_status(self):
sf = StatusFieldDefaultFilled._meta.get_field('status')
args, kwargs = introspector(sf)
self.assertEqual(kwargs['no_check_for_status'], 'True')
@skipUnless(introspector, 'South is not installed')
class SouthFreezingTests(TestCase):
def test_introspector_adds_no_excerpt_field(self):
mf = Article._meta.get_field('body')
args, kwargs = introspector(mf)
self.assertEqual(kwargs['no_excerpt_field'], 'True')


def test_no_excerpt_field_works(self):
from .models import NoRendered
self.assertRaises(FieldDoesNotExist,
NoRendered._meta.get_field,
'_body_excerpt')

def test_status_field_no_check_for_status(self):
sf = StatusFieldDefaultFilled._meta.get_field('status')
args, kwargs = introspector(sf)
self.assertEqual(kwargs['no_check_for_status'], 'True')



Expand Down
78 changes: 51 additions & 27 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,85 +1,109 @@
[tox]
envlist =
py26-1.4, py26-1.5, py26-trunk,
py27-1.4, py27-1.5, py27-trunk, py27-1.4-nosouth,
py32-1.5-nosouth, py32-trunk-nosouth,
py33-1.5-nosouth, py33-trunk-nosouth
py26-1.4, py26-1.5, py26-1.6,
py27-1.4, py27-1.5, py27-1.6, py27-trunk, py27-1.5-nosouth,
py32-1.5, py32-1.6, py32-trunk,
py33-1.5, py33-1.6, py33-trunk

[testenv]
deps =
South == 0.7.6
South == 0.8.1
coverage == 3.6
commands = coverage run -a setup.py test

[testenv:py26-1.4]
basepython = python2.6
deps =
django == 1.4.5
Django == 1.4.5
South == 0.7.6
coverage == 3.6

[testenv:py26-1.5]
basepython = python2.6
deps =
django == 1.5.1
South == 0.7.6
Django == 1.5.1
South == 0.8.1
coverage == 3.6

[testenv:py26-trunk]
[testenv:py26-1.6]
basepython = python2.6
deps =
https://github.com/django/django/tarball/master
South == 0.7.6
https://github.com/django/django/tarball/stable/1.6.x
South == 0.8.1
coverage == 3.6

[testenv:py27-1.4]
basepython = python2.7
deps =
django == 1.4.5
South == 0.7.6
Django == 1.4.5
South == 0.8.1
coverage == 3.6

[testenv:py27-1.5]
basepython = python2.7
deps =
django == 1.5.1
South == 0.7.6
Django == 1.5.1
South == 0.8.1
coverage == 3.6

[testenv:py27-1.6]
basepython = python2.7
deps =
https://github.com/django/django/tarball/stable/1.6.x
South == 0.8.1
coverage == 3.6

[testenv:py27-trunk]
basepython = python2.7
deps =
https://github.com/django/django/tarball/master
South == 0.7.6
South == 0.8.1
coverage == 3.6

[testenv:py27-1.5-nosouth]
basepython = python2.7
deps =
Django == 1.5.1
coverage == 3.6

[testenv:py32-1.5]
basepython = python3.2
deps =
Django == 1.5.1
South == 0.8.1
coverage == 3.6

[testenv:py32-1.5-nosouth]
[testenv:py32-1.6]
basepython = python3.2
deps =
django == 1.5.1
https://github.com/django/django/tarball/stable/1.6.x
South == 0.8.1
coverage == 3.6

[testenv:py32-trunk-nosouth]
[testenv:py32-trunk]
basepython = python3.2
deps =
https://github.com/django/django/tarball/master
South == 0.8.1
coverage == 3.6

[testenv:py33-1.5-nosouth]
[testenv:py33-1.5]
basepython = python3.3
deps =
django == 1.5.1
Django == 1.5.1
South == 0.8.1
coverage == 3.6

[testenv:py33-trunk-nosouth]
[testenv:py33-1.6]
basepython = python3.3
deps =
https://github.com/django/django/tarball/master
https://github.com/django/django/tarball/stable/1.6.x
South == 0.8.1
coverage == 3.6


[testenv:py27-1.4-nosouth]
basepython = python2.7
[testenv:py33-trunk]
basepython = python3.3
deps =
django == 1.4.5
https://github.com/django/django/tarball/master
South == 0.8.1
coverage == 3.6

0 comments on commit 59327dc

Please sign in to comment.