mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.9.x] Fixed #25592 -- Fixed misnamed strictly_above PostGIS lookup
Fixes a regression from2bd1bbc42. Thanks Daniel Wiesmann for the report and Tim Graham for the review. Backport ofc08f85fd54from master.
This commit is contained in:
		| @@ -1,13 +1,30 @@ | ||||
| from unittest import skip | ||||
| import unittest | ||||
| from functools import wraps | ||||
|  | ||||
| from django.conf import settings | ||||
| from django.db import DEFAULT_DB_ALIAS | ||||
| from django.db import DEFAULT_DB_ALIAS, connection | ||||
|  | ||||
|  | ||||
| def skipUnlessGISLookup(*gis_lookups): | ||||
|     """ | ||||
|     Skip a test unless a database supports all of gis_lookups. | ||||
|     """ | ||||
|     def decorator(test_func): | ||||
|         @wraps(test_func) | ||||
|         def skip_wrapper(*args, **kwargs): | ||||
|             if any(key not in connection.ops.gis_operators for key in gis_lookups): | ||||
|                 raise unittest.SkipTest( | ||||
|                     "Database doesn't support all the lookups: %s" % ", ".join(gis_lookups) | ||||
|                 ) | ||||
|             return test_func(*args, **kwargs) | ||||
|         return skip_wrapper | ||||
|     return decorator | ||||
|  | ||||
|  | ||||
| def no_backend(test_func, backend): | ||||
|     "Use this decorator to disable test on specified backend." | ||||
|     if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend: | ||||
|         @skip("This test is skipped on '%s' backend" % backend) | ||||
|         @unittest.skip("This test is skipped on '%s' backend" % backend) | ||||
|         def inner(): | ||||
|             pass | ||||
|         return inner | ||||
|   | ||||
		Reference in New Issue
	
	Block a user