Created
November 23, 2013 16:34
-
-
Save claudep/7616757 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def test_connection_import_doesnt_configure_settings(self): | |
""" | |
Test that importing django.db doesn't trigger settings configuration. | |
""" | |
from django.conf import settings | |
from django.utils.functional import empty | |
old_wrapped = settings._wrapped | |
settings._wrapped = empty | |
try: | |
self.assertFalse(settings.configured) | |
from django import db | |
reload(db) | |
self.assertFalse(settings.configured) | |
finally: | |
settings._wrapped = old_wrapped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment