Skip to content

Commit

Permalink
Major mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Mar 25, 2014
1 parent a238b1b commit 2b93cb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions djgeojson/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,21 +470,21 @@ def setUp(self):
self.r2 = Route.objects.create(geom=LineString((0, -1), (-10, -1)))

def test_view_is_serialized_as_geojson(self):
self.view.args = [8, 7, 4]
self.view.args = [4, 8, 7]
response = self.view.render_to_response(context={})
geojson = json.loads(smart_text(response.content))
self.assertEqual(geojson['features'][0]['geometry']['coordinates'],
[[0.0, 1.0], [10.0, 1.0]])

def test_view_trims_to_geometries_boundaries(self):
self.view.args = [128, 127, 8]
self.view.args = [8, 128, 127]
response = self.view.render_to_response(context={})
geojson = json.loads(smart_text(response.content))
self.assertEqual(geojson['features'][0]['geometry']['coordinates'],
[[0.0, 1.0], [1.40625, 1.0]])

def test_geometries_trim_can_be_disabled(self):
self.view.args = [128, 127, 8]
self.view.args = [8, 128, 127]
self.view.trim_to_boundary = False
response = self.view.render_to_response(context={})
geojson = json.loads(smart_text(response.content))
Expand All @@ -500,11 +500,11 @@ def test_zoom_0_queryset_contains_all(self):
self.assertEqual(2, len(self.view.get_queryset()))

def test_zoom_4_filters_by_tile_extent(self):
self.view.args = [8, 7, 4]
self.view.args = [4, 8, 7]
self.assertEqual([self.r1], list(self.view.get_queryset()))

def test_some_tiles_have_empty_queryset(self):
self.view.args = [6, 8, 4]
self.view.args = [4, 6, 8]
self.assertEqual(0, len(self.view.get_queryset()))


Expand Down
2 changes: 1 addition & 1 deletion djgeojson/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_queryset(self):
"""
Inspired by Glen Roberton's django-geojson-tiles view
"""
self.x, self.y, self.z = map(int, self.args[:3])
self.z, self.x, self.y = map(int, self.args[:3])
nw = self.tile_coord(self.x, self.y, self.z)
se = self.tile_coord(self.x + 1, self.y + 1, self.z)
bbox = Polygon((nw, (se[0], nw[1]),
Expand Down

0 comments on commit 2b93cb1

Please sign in to comment.