{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/87635584","pull_request_review_id":8243776,"id":87635584,"diff_hunk":"@@ -645,6 +645,19 @@ def test_distance_order_by(self):\n         ).values_list('name', flat=True).filter(name__in=('San Antonio', 'Pearland'))\n         self.assertSequenceEqual(qs, ['San Antonio', 'Pearland'])\n \n+    @skipUnlessDBFeature(\"has_Distance_function\")\n+    def test_distance_not_deprecated(self):\n+        if postgis:\n+            hillsdale = AustraliaCity.objects.get(name='Hillsdale')","path":"tests/gis_tests/distapp/tests.py","position":7,"original_position":7,"commit_id":"44698c512753864987cd187280a30a898093ff97","original_commit_id":"44698c512753864987cd187280a30a898093ff97","user":{"login":"claudep","id":143192,"avatar_url":"https://avatars.githubusercontent.com/u/143192?v=3","gravatar_id":"","url":"https://api.github.com/users/claudep","html_url":"https://github.com/claudep","followers_url":"https://api.github.com/users/claudep/followers","following_url":"https://api.github.com/users/claudep/following{/other_user}","gists_url":"https://api.github.com/users/claudep/gists{/gist_id}","starred_url":"https://api.github.com/users/claudep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudep/subscriptions","organizations_url":"https://api.github.com/users/claudep/orgs","repos_url":"https://api.github.com/users/claudep/repos","events_url":"https://api.github.com/users/claudep/events{/privacy}","received_events_url":"https://api.github.com/users/claudep/received_events","type":"User","site_admin":false},"body":"As the whole test is postgis-specific, use a decorator instead (`@skipUnless(postgis, \"This is a PostGIS-specific test\")`","created_at":"2016-11-11T18:35:36Z","updated_at":"2016-11-11T18:35:36Z","html_url":"https://github.com/django/django/pull/7539#discussion_r87635584","pull_request_url":"https://api.github.com/repos/django/django/pulls/7539","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/87635584"},"html":{"href":"https://github.com/django/django/pull/7539#discussion_r87635584"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/7539"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/7539","id":93240079,"html_url":"https://github.com/django/django/pull/7539","diff_url":"https://github.com/django/django/pull/7539.diff","patch_url":"https://github.com/django/django/pull/7539.patch","issue_url":"https://api.github.com/repos/django/django/issues/7539","number":7539,"state":"open","locked":false,"title":"Fixed #27448 -- Don't use deprecated PostGIS functions, depending on PostGIS version.","user":{"login":"roques","id":523218,"avatar_url":"https://avatars.githubusercontent.com/u/523218?v=3","gravatar_id":"","url":"https://api.github.com/users/roques","html_url":"https://github.com/roques","followers_url":"https://api.github.com/users/roques/followers","following_url":"https://api.github.com/users/roques/following{/other_user}","gists_url":"https://api.github.com/users/roques/gists{/gist_id}","starred_url":"https://api.github.com/users/roques/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roques/subscriptions","organizations_url":"https://api.github.com/users/roques/orgs","repos_url":"https://api.github.com/users/roques/repos","events_url":"https://api.github.com/users/roques/events{/privacy}","received_events_url":"https://api.github.com/users/roques/received_events","type":"User","site_admin":false},"body":"PostGIS 2.2.0 deprecated `ST_distance_sphere` in favour of `ST_DistanceSphere` and a few other functions. See: https://trac.osgeo.org/postgis/ticket/2748\r\nThe old functions are still available, but now issue deprecation warnings, which significantly slows them down (>40× for me).\r\n`django.contrib.db.backends.postgis` currently requires PostGIS ≥2.1.0. Unfortunately, the not deprecated replacement functions only became available with PostGIS 2.2.0. So, to retain compatibility with PostGIS 2.1.0 we have to switch functions depending on the PostGIS version.\r\n\r\nThis branch contains:\r\n * A test-case for the deprecated functions being used (Thanks Mjumbe Wawatu Poe for the initial patch!)\r\n * Some trivial documentation updates.\r\n * A simple fix, which determines the functions to use in `PostGISOperations.__init__`\r\n * A test-case for the fix.\r\n * A more lazily evaluated, but a bit larger fix, which does not confuse Django's testsuite by evaluating an SQL-query when instantiating `PostGISOperations`.\r\n\r\nI'll squash it all into one commit after review and patch-up. Either with or without the lazy fix.\r\n\r\nTicket: https://code.djangoproject.com/ticket/27448","created_at":"2016-11-10T22:04:44Z","updated_at":"2016-11-11T18:35:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03a228e7e068059894a1e6d96ff82c96c5e84e9d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/7539/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/7539/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/7539/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/44698c512753864987cd187280a30a898093ff97","head":{"label":"roques:postgis22_deprecated","ref":"postgis22_deprecated","sha":"44698c512753864987cd187280a30a898093ff97","user":{"login":"roques","id":523218,"avatar_url":"https://avatars.githubusercontent.com/u/523218?v=3","gravatar_id":"","url":"https://api.github.com/users/roques","html_url":"https://github.com/roques","followers_url":"https://api.github.com/users/roques/followers","following_url":"https://api.github.com/users/roques/following{/other_user}","gists_url":"https://api.github.com/users/roques/gists{/gist_id}","starred_url":"https://api.github.com/users/roques/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roques/subscriptions","organizations_url":"https://api.github.com/users/roques/orgs","repos_url":"https://api.github.com/users/roques/repos","events_url":"https://api.github.com/users/roques/events{/privacy}","received_events_url":"https://api.github.com/users/roques/received_events","type":"User","site_admin":false},"repo":{"id":72894220,"name":"django","full_name":"roques/django","owner":{"login":"roques","id":523218,"avatar_url":"https://avatars.githubusercontent.com/u/523218?v=3","gravatar_id":"","url":"https://api.github.com/users/roques","html_url":"https://github.com/roques","followers_url":"https://api.github.com/users/roques/followers","following_url":"https://api.github.com/users/roques/following{/other_user}","gists_url":"https://api.github.com/users/roques/gists{/gist_id}","starred_url":"https://api.github.com/users/roques/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roques/subscriptions","organizations_url":"https://api.github.com/users/roques/orgs","repos_url":"https://api.github.com/users/roques/repos","events_url":"https://api.github.com/users/roques/events{/privacy}","received_events_url":"https://api.github.com/users/roques/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/roques/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/roques/django","forks_url":"https://api.github.com/repos/roques/django/forks","keys_url":"https://api.github.com/repos/roques/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roques/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roques/django/teams","hooks_url":"https://api.github.com/repos/roques/django/hooks","issue_events_url":"https://api.github.com/repos/roques/django/issues/events{/number}","events_url":"https://api.github.com/repos/roques/django/events","assignees_url":"https://api.github.com/repos/roques/django/assignees{/user}","branches_url":"https://api.github.com/repos/roques/django/branches{/branch}","tags_url":"https://api.github.com/repos/roques/django/tags","blobs_url":"https://api.github.com/repos/roques/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roques/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roques/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/roques/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roques/django/statuses/{sha}","languages_url":"https://api.github.com/repos/roques/django/languages","stargazers_url":"https://api.github.com/repos/roques/django/stargazers","contributors_url":"https://api.github.com/repos/roques/django/contributors","subscribers_url":"https://api.github.com/repos/roques/django/subscribers","subscription_url":"https://api.github.com/repos/roques/django/subscription","commits_url":"https://api.github.com/repos/roques/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/roques/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/roques/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/roques/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/roques/django/contents/{+path}","compare_url":"https://api.github.com/repos/roques/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roques/django/merges","archive_url":"https://api.github.com/repos/roques/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roques/django/downloads","issues_url":"https://api.github.com/repos/roques/django/issues{/number}","pulls_url":"https://api.github.com/repos/roques/django/pulls{/number}","milestones_url":"https://api.github.com/repos/roques/django/milestones{/number}","notifications_url":"https://api.github.com/repos/roques/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roques/django/labels{/name}","releases_url":"https://api.github.com/repos/roques/django/releases{/id}","deployments_url":"https://api.github.com/repos/roques/django/deployments","created_at":"2016-11-05T00:00:05Z","updated_at":"2016-11-05T00:00:26Z","pushed_at":"2016-11-11T15:24:12Z","git_url":"git://github.com/roques/django.git","ssh_url":"git@github.com:roques/django.git","clone_url":"https://github.com/roques/django.git","svn_url":"https://github.com/roques/django","homepage":"https://www.djangoproject.com/","size":151611,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"1446902be48ebf19bfe484371897a2815dd21fca","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","deployments_url":"https://api.github.com/repos/django/django/deployments","created_at":"2012-04-28T02:47:18Z","updated_at":"2016-11-11T18:30:19Z","pushed_at":"2016-11-11T18:05:45Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":216785,"stargazers_count":22096,"watchers_count":22096,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8890,"mirror_url":null,"open_issues_count":125,"forks":8890,"open_issues":125,"watchers":22096,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/7539"},"html":{"href":"https://github.com/django/django/pull/7539"},"issue":{"href":"https://api.github.com/repos/django/django/issues/7539"},"comments":{"href":"https://api.github.com/repos/django/django/issues/7539/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/7539/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/7539/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/44698c512753864987cd187280a30a898093ff97"}}}}
{"actor":{"display_login":"claudep"}}