Skip to content

Commit

Permalink
Fix and update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
yesimon committed Feb 20, 2015
1 parent 3078148 commit 2c7822e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Expand Up @@ -3,9 +3,8 @@ python:
- "2.7"
- "3.4"
env:
- DJANGO=1.5.12
- DJANGO=1.6.9
- DJANGO=1.7.2
- DJANGO=1.6.10
- DJANGO=1.7.4
install:
- pip install -q Django==$DJANGO
- pip install coveralls
Expand Down
8 changes: 5 additions & 3 deletions runtests.py
Expand Up @@ -2,9 +2,7 @@
from __future__ import unicode_literals
import sys

import django
from django.conf import settings
from django.test.utils import get_runner


if not settings.configured:
Expand Down Expand Up @@ -48,7 +46,11 @@


def runtests():
django.setup()
from django import VERSION
if VERSION[1] >= 7:
from django import setup
setup()
from django.test.utils import get_runner
TestRunner = get_runner(settings)
test_runner = TestRunner()
failures = test_runner.run_tests(["tests"])
Expand Down
4 changes: 2 additions & 2 deletions tests/tests.py
Expand Up @@ -134,7 +134,7 @@ def test_invite_non_user_without_email(self):
self.client.login(username='dany', password='secret')
response = self.client.get(reverse('invited_only'))
# Dany should be denied, since he has no connection with email account
self.assertRedirects(response, reverse('hunger-invalid', args=[code]))
self.assertRedirects(response, reverse('hunger-invalid', args=[code.code]))

def test_invite_non_user_public_invitation(self):
"""
Expand Down Expand Up @@ -171,7 +171,7 @@ def test_invite_existing_user_without_email(self):
self.client.login(username='alice', password='secret')
response = self.client.get(reverse('invited_only'))
# Alice should be denied, since she has no connection with email account
self.assertRedirects(response, reverse('hunger-invalid', args=[code]))
self.assertRedirects(response, reverse('hunger-invalid', args=[code.code]))

def test_invalid_code(self):
"""
Expand Down
26 changes: 13 additions & 13 deletions tox.ini
@@ -1,28 +1,28 @@
[tox]
envlist =
py34-django17,
py27-django17,
py34-django16,
py27-django16,
py27-django15,
py26-django15
py27-django16

[testenv]
commands = python runtests.py

[testenv:py34-django16]
[testenv:py34-django17]
basepython = python3.4
deps = Django==1.6.2
deps = Django==1.7.4

[testenv:py27-django16]
[testenv:py27-django17]
basepython = python2.7
deps = Django==1.6.2
deps = Django==1.7.4

[testenv:py27-django15]
basepython = python2.7
deps = Django==1.5.5
[testenv:py34-django16]
basepython = python3.4
deps = Django==1.6.10

[testenv:py26-django15]
basepython = python2.6
deps = Django==1.5.5
[testenv:py27-django16]
basepython = python2.7
deps = Django==1.6.10

[pep8]
ignore=

0 comments on commit 2c7822e

Please sign in to comment.