Skip to content

Instantly share code, notes, and snippets.

@bmispelon
Created October 18, 2013 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmispelon/7041561 to your computer and use it in GitHub Desktop.
Save bmispelon/7041561 to your computer and use it in GitHub Desktop.
Test case for django ticket #21281. https://code.djangoproject.com/ticket/21281
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