|
1 | | -import json |
2 | 1 | import os |
3 | 2 | import re |
4 | 3 | import unittest |
5 | 4 |
|
6 | 5 | import django |
7 | 6 | import html5lib |
8 | | -from django.conf import settings |
9 | 7 | from django.contrib.staticfiles.testing import StaticLiveServerTestCase |
10 | 8 | from django.core import signing |
11 | 9 | from django.core.cache import cache |
|
18 | 16 | from debug_toolbar.forms import SignedDataForm |
19 | 17 | from debug_toolbar.middleware import DebugToolbarMiddleware, show_toolbar |
20 | 18 | from debug_toolbar.panels import Panel |
21 | | -from debug_toolbar.panels.sql.forms import SQLSelectForm |
22 | 19 | from debug_toolbar.toolbar import DebugToolbar |
23 | 20 |
|
24 | 21 | from .base import BaseTestCase, IntegrationTestCase |
@@ -310,28 +307,6 @@ def test_sql_explain_checks_show_toolbar(self): |
310 | 307 | ) |
311 | 308 | self.assertEqual(response.status_code, 404) |
312 | 309 |
|
313 | | - @unittest.skipUnless(settings.USE_GIS, "Test only valid with gis support") |
314 | | - def test_sql_explain_gis(self): |
315 | | - from django.contrib.gis.geos import GEOSGeometry |
316 | | - |
317 | | - from .models import Location |
318 | | - |
319 | | - db_table = Location._meta.db_table |
320 | | - |
321 | | - url = "/__debug__/sql_explain/" |
322 | | - geom = GEOSGeometry("POLYGON((0 0, 0 1, 1 1, 0 0))") |
323 | | - data = { |
324 | | - "sql": f'SELECT "{db_table}"."point" FROM "{db_table}" WHERE "{db_table}"."point" @ {geom.hex} LIMIT 1', |
325 | | - "raw_sql": f'SELECT "{db_table}"."point" FROM "{db_table}" WHERE "{db_table}"."point" @ %s LIMIT 1', |
326 | | - "params": json.dumps([geom.hex]), |
327 | | - "alias": "default", |
328 | | - "duration": "0", |
329 | | - } |
330 | | - data["hash"] = SQLSelectForm().make_hash(data) |
331 | | - |
332 | | - response = self.client.post(url, data=data) |
333 | | - self.assertEqual(response.status_code, 200) |
334 | | - |
335 | 310 | @unittest.skipUnless( |
336 | 311 | connection.vendor == "postgresql", "Test valid only on PostgreSQL" |
337 | 312 | ) |
|
0 commit comments