Skip to content

Commit

Permalink
added python3 support #22
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Aug 11, 2014
1 parent b6d9d70 commit da0287b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@ services:
- postgresql

python:
- "3.4"
- "3.3"
- "2.7"
- "2.6"

env:
- DJANGO="https://www.djangoproject.com/download/1.7c2/tarball/"
- DJANGO="django==1.5.8"
- DJANGO="django==1.6.5"

matrix:
exclude:
- python: "2.6"
env: DJANGO="https://www.djangoproject.com/download/1.7c2/tarball/"

branches:
only:
- master

# command to install requirements
install:
- pip install $DJANGO
- pip install $DJANGO --use-mirrors
- pip install psycopg2 djangorestframework coverage coveralls django-filter --use-mirrors
- python setup.py -q install

Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
]
)
2 changes: 1 addition & 1 deletion tests/django_restframework_gis_tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __unicode__(self):

def _generate_slug(self):
if self.slug == '' or self.slug is None:
self.slug = slugify(unicode(self.name))
self.slug = slugify(self.name)

def clean(self):
self._generate_slug()
Expand Down
9 changes: 7 additions & 2 deletions tests/django_restframework_gis_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,12 @@ def test_GeometryField_filtering(self):

point_inside_ggpark_geojson = """{ "type": "Point", "coordinates": [ -122.49034881591797, 37.76949349270407 ] }"""

url_params = "?contains_properly=%s" % urllib.quote(point_inside_ggpark_geojson)
try:
quoted_param = urllib.quote(point_inside_ggpark_geojson)
except AttributeError:
quoted_param = urllib.parse.quote(point_inside_ggpark_geojson)

url_params = "?contains_properly=%s" % quoted_param

response = self.client.get(self.geojson_contained_in_geometry + url_params)
self.assertEqual(len(response.data), 1)
Expand Down Expand Up @@ -635,5 +640,5 @@ def test_geojson_HTML_widget_value(self):
self._create_locations()
response = self.client.get(self.geojson_location_list_url, HTTP_ACCEPT='text/html')
self.assertContains(response, '<textarea cols="40" id="geometry"')
self.assertContains(response, '&quot;type&quot;: &quot;Point&quot;,')
self.assertContains(response, '&quot;type&quot;: &quot;Point&quot;')
self.assertContains(response, '&quot;coordinates&quot;: [')

0 comments on commit da0287b

Please sign in to comment.