Last active
December 20, 2015 16:59
-
-
Save nickpresta/6165605 to your computer and use it in GitHub Desktop.
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
## CALLING CODE | |
from django.conf import settings | |
def my_function(): | |
foo = getattr(settings, 'foo', None) | |
if foo: | |
return foo.BAR | |
return BAZ | |
## TEST | |
def test_settings_dont_have_foo(self): | |
with self.settings(## UNSET FOO ##): | |
value = my_function() | |
self.assertEquals(value, BAZ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment