def test_change_app(self): some_app = object() set_current_app(some_app) self.assertIs(some_app, get_current_app())
def test_no_app_created(self): with self.assertRaises(RuntimeError): get_current_app()
def test_current_app(self): some_app = ThriftWorker() self.assertIs(some_app, get_current_app())