Skip to content

Commit

Permalink
Properly marked skipped GIS tests as skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Sep 24, 2013
1 parent 45403d3 commit 18fb713
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions django/contrib/gis/tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from unittest import skip

from django.conf import settings
from django.db import DEFAULT_DB_ALIAS

# function that will pass a test.
def pass_test(*args): return

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:
return pass_test
@skip("This test is skipped on '%s' backend" % backend)
def inner():
pass
return inner
else:
return test_func

Expand Down

0 comments on commit 18fb713

Please sign in to comment.