def test_is_properly_configured(): settings.TWITTER_CONSUMER_KEY = 'foo' settings.TWITTER_CONSUMER_SECRET = 'foo' settings.TWITTER_OAUTH_TOKEN = 'foo' settings.TWITTER_OAUTH_TOKEN_SECRET = 'foo' assert twitter.is_properly_configured() settings.TWITTER_CONSUMER_KEY = '' assert not twitter.is_properly_configured() delattr(settings, 'TWITTER_CONSUMER_KEY') assert not twitter.is_properly_configured()
def test_is_properly_configured_missing_data(self): config = self.create_settings() config['oauth_token'] = None assert not is_properly_configured(config)
def test_is_properly_configured(self): assert is_properly_configured(self.create_settings())