Skip to content

Commit

Permalink
Merge pull request #26 from texastribune/dj17-and-testing-refresh
Browse files Browse the repository at this point in the history
Django 1.7 and testing refresh
  • Loading branch information
crccheck committed Sep 3, 2014
2 parents f347dd4 + 1869129 commit c446423
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 28 deletions.
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]
source = django_object_actions
omit =
*/tests/*

[report]
exclude_lines =
pragma: no cover
__repr__
__unicode__
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ media
*.pot
*.pyc
.DS_Store
.coverage
.sass-cache


Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ MANAGE=$(PROJECT)/manage.py

help:
@echo "make commands:"
@echo " make help - this help"
@echo " make clean - remove files generated by distutils"
@echo " make test - run test suite"
@echo " make resetdb - delete and recreate the sqlite database"
@echo " make help - this help"
@echo " make clean - remove files generated by distutils"
@echo " make test - run test suite"
@echo " make coverage - run coverage"
@echo " make resetdb - delete and recreate the sqlite database"


clean:
rm -rf .coverage
rm -rf .tox
rm -rf MANIFEST
rm -rf build
Expand All @@ -18,15 +20,13 @@ clean:


test:
#
# -s don't capture stdout
#
python -W ignore::RuntimeWarning $(MANAGE) test django_object_actions -s
python -W ignore::RuntimeWarning $(MANAGE) test django_object_actions

coverage:
coverage erase
coverage run $(MANAGE) test django_object_actions
coverage report --show-missing

resetdb:
python $(MANAGE) reset_db --router=default --noinput
python $(MANAGE) syncdb --noinput


.PHONY: help clean test resetdb
7 changes: 6 additions & 1 deletion django_object_actions/factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from django.contrib.auth import get_user_model
try:
from django.contrib.auth import get_user_model
except ImportError: # pragma: no cover
# Django 1.4
from django.contrib.auth.models import User
get_user_model = lambda: User

import factory

Expand Down
4 changes: 4 additions & 0 deletions django_object_actions/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# HACK to get factoryboy logging to shut up
import logging
logging.getLogger("factory").setLevel(logging.WARN)

# DJANGO 1.4 DJANGO 1.5
from .test_utils import *
from .tests import *
4 changes: 0 additions & 4 deletions example_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,8 @@ def project_dir(*paths):

# dev helpers
'django_extensions',
# testing
'django_nose',
)

TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'


# STFU, Django 1.7
# To be deleted once Django 1.8 testing begins
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ psycopg2>=2.4.5

Werkzeug>=0.8.3
django-extensions>=0.9
django-nose
tox==1.7.1
factory-boy==2.4.1
coverage==3.7.1
21 changes: 10 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,65 +25,64 @@ commands = {envpython} example_project/manage.py test django_object_actions
deps =
dj_database_url
django-extensions>=0.9
django-nose
factory-boy==2.4.1

[testenv:py26django14]
basepython=python2.6
deps =
{[testenv]deps}
django>=1.4,>1.5
Django>=1.4,<1.5

[testenv:py26django15]
basepython=python2.6
deps =
{[testenv]deps}
django>=1.5,>1.6
Django>=1.5,<1.6

[testenv:py27django14]
basepython=python2.7
deps =
{[testenv]deps}
django>=1.4,>1.5
Django>=1.4,<1.5

[testenv:py27django15]
basepython=python2.7
deps =
{[testenv]deps}
django>=1.5,>1.6
Django>=1.5,<1.6

[testenv:py27django16]
basepython=python2.7
deps =
{[testenv]deps}
django>=1.6,>1.5
Django>=1.6,<1.5

[testenv:py33django16]
basepython=python3.3
deps =
{[testenv]deps}
django>=1.6,>1.5
Django>=1.6,<1.5

[testenv:py27django17]
basepython=python2.7
deps =
{[testenv]deps}
https://www.djangoproject.com/download/1.7c1/tarball/
Django>=1.7,<1.8

[testenv:py33django17]
basepython=python3.3
deps =
{[testenv]deps}
https://www.djangoproject.com/download/1.7c1/tarball/
Django>=1.7,<1.8

[testenv:py34django16]
basepython=python3.4
deps =
{[testenv]deps}
django>=1.6,>1.5
Django>=1.6,<1.5

[testenv:py34django17]
basepython=python3.4
deps =
{[testenv]deps}
https://www.djangoproject.com/download/1.7c1/tarball/
Django>=1.7,<1.8

0 comments on commit c446423

Please sign in to comment.