diff --git a/django/test/utils.py b/django/test/utils.py index 9673a26b98e..0ca7a1a25d0 100644 --- a/django/test/utils.py +++ b/django/test/utils.py @@ -211,6 +211,7 @@ class override_settings(object): { '_pre_setup': _pre_setup, '_post_teardown': _post_teardown, + '__module__': test_func.__module__, }) else: @wraps(test_func) diff --git a/tests/regressiontests/settings_tests/tests.py b/tests/regressiontests/settings_tests/tests.py index 6af2ed307b9..3f76368cea8 100644 --- a/tests/regressiontests/settings_tests/tests.py +++ b/tests/regressiontests/settings_tests/tests.py @@ -18,6 +18,9 @@ class FullyDecoratedTranTestCase(TransactionTestCase): def test_decorated_testcase_name(self): self.assertEquals(FullyDecoratedTranTestCase.__name__, 'FullyDecoratedTranTestCase') + def test_decorated_testcase_module(self): + self.assertEquals(FullyDecoratedTranTestCase.__module__, __name__) + FullyDecoratedTranTestCase = override_settings(TEST='override')(FullyDecoratedTranTestCase) # @override_settings(TEST='override')