Commit cab4617c authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

snf_django: Preserve name of test_ functions

When decorating a test_ function, wrap it, so that nose can detect it
as a test function.
parent b83ed8c8
...@@ -19,6 +19,7 @@ from django.test import TestCase ...@@ -19,6 +19,7 @@ from django.test import TestCase
from django.utils import simplejson as json from django.utils import simplejson as json
from django.utils.encoding import smart_unicode from django.utils.encoding import smart_unicode
from mock import patch from mock import patch
import functools
class MurphysLaw(Exception): class MurphysLaw(Exception):
...@@ -123,6 +124,7 @@ def override_settings(settings, **kwargs): ...@@ -123,6 +124,7 @@ def override_settings(settings, **kwargs):
def with_settings(settings, prefix='', **override): def with_settings(settings, prefix='', **override):
def wrapper(func): def wrapper(func):
@functools.wraps(func)
def inner(*args, **kwargs): def inner(*args, **kwargs):
with override_settings(settings, prefix=prefix, **override): with override_settings(settings, prefix=prefix, **override):
ret = func(*args, **kwargs) ret = func(*args, **kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment