Skip to content

Commit

Permalink
Merge f437fdd into 8ffbed8
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Jun 30, 2018
2 parents 8ffbed8 + f437fdd commit c882b8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 3 additions & 7 deletions .travis.yml
@@ -1,16 +1,12 @@
language: python
python:
- 2.7
- 3.6
env:
- DJANGO=Django==1.4.0
- DJANGO=Django==1.5.0
- DJANGO=Django==1.6.0
- DJANGO=Django==1.7.0
- DJANGO=Django==1.11.0
install:
- pip install $DJANGO
- pip install mock==1.0.1
- pip install coverage==3.7.1
- pip install coveralls==0.4.1
- pip install mock==1.0.1 coverage==3.7.1 coveralls==0.4.1
script:
- coverage run --source=django_test_mixins.py tests.py
after_success:
Expand Down
7 changes: 5 additions & 2 deletions django_test_mixins.py
@@ -1,7 +1,10 @@
from django.test import TestCase
from django.core.cache import cache

import urlparse
try:
from urlparse import urljoin # python2
except ImportError:
from urllib.parse import urljoin # python3


class HttpCodeTestCase(TestCase):
Expand Down Expand Up @@ -32,7 +35,7 @@ def assertHttpRedirect(self, response, location=None):
if location.startswith("http://testserver/"):
absolute_location = location
else:
absolute_location = urlparse.urljoin("http://testserver/", location)
absolute_location = urljoin("http://testserver/", location)

self.assertEqual(response['Location'], absolute_location)

Expand Down

0 comments on commit c882b8a

Please sign in to comment.