Created
October 18, 2013 13:29
-
-
Save bmispelon/7041561 to your computer and use it in GitHub Desktop.
Test case for django ticket #21281.
https://code.djangoproject.com/ticket/21281
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py | |
index af2eef6..88c1359 100644 | |
--- a/tests/test_utils/tests.py | |
+++ b/tests/test_utils/tests.py | |
@@ -3,17 +3,28 @@ from __future__ import unicode_literals | |
import unittest | |
+from django.conf import settings | |
from django.db import connection | |
from django.forms import EmailField, IntegerField | |
from django.http import HttpResponse | |
from django.template.loader import render_to_string | |
from django.test import SimpleTestCase, TestCase, skipIfDBFeature, skipUnlessDBFeature | |
from django.test.html import HTMLParseError, parse_html | |
-from django.test.utils import CaptureQueriesContext, IgnoreAllDeprecationWarningsMixin | |
+from django.test.utils import CaptureQueriesContext, IgnoreAllDeprecationWarningsMixin, override_settings | |
from django.utils import six | |
from .models import Person | |
+@override_settings(FOO='lol') | |
+class FooTestCase(TestCase): | |
+ | |
+ @classmethod | |
+ def setUpClass(cls): | |
+ cls.foo = getattr(settings, 'FOO', 'BUG') | |
+ | |
+ def test_foo(self): | |
+ self.assertNotEqual(self.foo, 'BUG') | |
+ | |
class SkippingTestCase(TestCase): | |
def test_skip_unless_db_feature(self): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment