def test_get_token_and_login_is_deprecated(self): # get_token_and_login() works but triggers a deprecation warning. with warnings.catch_warnings(record=True) as caught: warnings.simplefilter("always") NoNetworkLaunchpad.get_token_and_login('consumer') self.assertEquals(len(caught), 1) self.assertEquals(caught[0].category, DeprecationWarning)